/* Sea Stories Oyster & Raw Bar
   ---------------------------------------------------------------- */

/* Fonts ----------------------------------------------------------- */

@font-face {
  font-family: "Young Serif";
  src: url("../assets/fonts/young-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bitter";
  src: url("../assets/fonts/bitter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Local fallbacks resized to match the web fonts, so text doesn't jump when they load */
@font-face {
  font-family: "Young Serif Fallback";
  src: local("Georgia");
  size-adjust: 115.66%;
  ascent-override: 90.44%;
  descent-override: 31.64%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Bitter Fallback";
  src: local("Georgia");
  size-adjust: 105.22%;
  ascent-override: 88.86%;
  descent-override: 25.18%;
  line-gap-override: 0%;
}

/* Tokens ---------------------------------------------------------- */

:root {
  --ink: #342e2e;
  --ink-deep: #1c1919;
  --ink-soft: #5b5453;
  --stone: #cfcdc8;
  --stone-light: #e4e2dd;
  --slate: #8b8b8b;
  --white: #fff;
  --field-border: #7d7774;
  --error: #9b2f1f;

  --line: rgb(52 46 46 / 0.2);

  --font-display: "Young Serif", "Young Serif Fallback", Georgia, serif;
  --font-body: "Bitter", "Bitter Fallback", Georgia, serif;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-space: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  --focus: var(--ink-deep);

  color-scheme: light;
}

/* Base ------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 1.4rem + 1.8vw, 2.875rem);
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

ul[role="list"] {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.site-header,
.hero {
  --focus: var(--white);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--white);
  color: var(--ink-deep);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Shared pieces --------------------------------------------------- */

.container {
  width: 100%;
  max-width: 90rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-space);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.75rem;
  padding: 0.875rem 3.5rem;
  border: 1px solid var(--stone);
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button:hover {
  border-color: var(--white);
  background: var(--white);
}

.button--dark {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.button--dark:hover {
  border-color: var(--ink-deep);
  background: var(--ink-deep);
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  flex: none;
}

/* Header (over the hero) ------------------------------------------ */

.site-header {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.75rem, 2.5vw, 1.75rem) var(--gutter);
  color: var(--white);
}

.site-header__logo {
  flex: none;
  /* trims the logo's empty margin so it lines up with the page edge */
  margin: -0.25rem 0 0 -0.35rem;
}

.site-header__logo img {
  width: clamp(6.5rem, 4.5rem + 7vw, 10.5rem);
  filter: drop-shadow(0 1px 8px rgb(0 0 0 / 0.35));
}

.site-nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.site-nav a {
  display: inline-block;
  padding-block: 0.5rem;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  text-decoration: none;
  text-shadow: 0 1px 6px rgb(0 0 0 / 0.4);
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

/* Hero ------------------------------------------------------------ */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--white);
}

.hero__media {
  position: absolute;
  inset: 0;
}

/* Darkens the photo so white text reads over its brightest parts (at least 5:1 behind
   the headline), a little more at the top behind the logo and links. */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgb(0 0 0 / 0.5), rgb(0 0 0 / 0) 32%),
    rgb(0 0 0 / 0.45);
  pointer-events: none;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The headline sits in the middle of the screen; the button rests near the bottom */
.hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: inherit;
}

.hero h1 {
  align-self: center;
  max-width: 18em;
  margin: 0 auto;
  padding: 6rem var(--gutter) 2rem;
  font-size: clamp(2rem, 1.25rem + 2vw, 2.875rem);
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 2px 16px rgb(0 0 0 / 0.35);
}

.hero .button {
  justify-self: center;
  margin-bottom: clamp(4.5rem, 10svh, 6rem);
}

/* Story ----------------------------------------------------------- */

.story {
  background: var(--stone);
}

.story__grid {
  display: grid;
  gap: 0 clamp(2rem, 5vw, 6rem);
}

.story h2 {
  margin-bottom: clamp(1.75rem, 1rem + 3vw, 4.5rem);
}

.story__text {
  max-width: 34rem;
}

.story__image {
  max-width: 28rem;
  margin-top: 1.5rem;
}

.story__image img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

@media (min-width: 960px) {
  .story__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 0.85fr);
    grid-template-rows: auto 1fr;
  }

  .story h2 {
    grid-column: 1 / 3;
  }

  .story__image {
    grid-column: 3;
    grid-row: 1 / 3;
    margin-top: 0;
  }
}

/* Contact --------------------------------------------------------- */

.contact {
  background: var(--stone-light);
}

.contact__grid {
  display: grid;
  gap: 2rem clamp(3rem, 6vw, 6rem);
}

.contact__intro {
  max-width: 28rem;
}

.contact__intro h2 {
  margin-bottom: 1.25rem;
}

.contact__form {
  max-width: 48rem;
}

@media (min-width: 960px) {
  .contact__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: start;
  }
}

/* Form ------------------------------------------------------------ */

.inquiry__group {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

/* Floated so the legend sits inside the fieldset instead of on its top border */
.inquiry__group > legend {
  float: left;
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
}

.inquiry__group > legend + * {
  clear: both;
}

.inquiry__group + .inquiry__group {
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  margin: 0 0 1.25rem;
  min-width: 0;
}

.field-row {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 640px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.field label,
.choices > legend {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
}

.field__optional {
  margin-left: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 400;
}

.field__hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.field input:not([type="checkbox"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.875rem;
  border: 1px solid var(--field-border);
  border-radius: 0;
  background: var(--white);
  color: var(--ink-deep);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
}

.field input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23342e2e' d='M7 9.5l5 5 5-5z'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.field input:not([type="checkbox"]):focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--ink-deep);
  outline: 2px solid var(--ink-deep);
  outline-offset: 1px;
}

.field [aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}

.field__error {
  margin: 0;
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 500;
}

.choices {
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.choices > legend {
  margin-bottom: 0.25rem;
  padding: 0;
}

.choices__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  font-size: 1rem;
  cursor: pointer;
}

.choice input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--ink);
}

.inquiry__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-top: 0.5rem;
}

.inquiry__note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.form-status {
  margin: 0;
  font-size: 0.9375rem;
}

.form-status:empty {
  display: none;
}

.form-errors {
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  border: 2px solid var(--error);
  background: var(--white);
}

.form-errors h3 {
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.25rem;
}

.form-errors a {
  color: var(--error);
  font-weight: 500;
}

/* Shown once the email app has been asked to open */
.inquiry-handoff {
  display: grid;
  gap: 1rem;
  justify-items: start;
  margin-top: 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-left: 4px solid var(--ink);
  background: var(--white);
}

.inquiry-handoff h3 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
}

/* Focus is moved here so screen readers announce it; it isn't something to click */
.inquiry-handoff h3:focus {
  outline: none;
}

.inquiry-handoff p {
  margin: 0;
}

.inquiry-handoff__text {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--field-border);
  background: var(--stone-light);
  color: var(--ink-deep);
  font: inherit;
  font-size: 0.9375rem;
  resize: vertical;
}

.button--outline {
  min-height: 3rem;
  padding: 0.625rem 1.5rem;
  border-color: var(--ink);
  background: transparent;
}

.button--outline:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

/* Footer ---------------------------------------------------------- */

.site-footer {
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) 2rem;
  background: var(--slate);
  color: var(--ink-deep);
}

.site-footer__main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 3rem;
}

.site-footer__name,
.site-footer__email {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 0.8rem + 2.2vw, 2.5rem);
  line-height: 1.15;
}

.site-footer__email {
  overflow-wrap: anywhere;
  text-decoration: none;
}

.site-footer__email:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.25rem;
  border-top: 1px solid rgb(28 25 25 / 0.3);
  font-size: 0.9375rem;
}

.site-footer__meta p {
  margin: 0;
}

.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  text-decoration: none;
}

.instagram-link:hover span {
  text-decoration: underline;
}

/* Motion ---------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
