/* Home page sections (Figma 46:927). Desktop layout; mobile comes in stage 3. */

/* Hero (46:929) */
.hero { padding: 60px 0 220px; } /* Figma 46:943: content at y=160 (header 100 + 60), 610 tall, photo top at 183; 990 − 160 − 610 = 220 */
@media (max-width: 767.98px) {
  .hero { padding: 40px 0 64px; } /* Figma 59:163: meta row 40px under the header, photo ends 64px above Projects */
}
.hero__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 103px;
}
.hero__text {
  flex: 0 1 657px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.hero__tags {
  flex-wrap: nowrap;
  white-space: nowrap;
  font: 400 16px/normal var(--font); /* Label/16 Regular */
  --divider-h: 14px;
  --divider-color: color-mix(in srgb, var(--text-primary) 50%, transparent);
}
.hero__title { color: var(--text-heading-grey); }
/* 768–1000px: the text column narrows, so the heading scales 40→60px (max 4–5 lines) */
@media (min-width: 768px) and (max-width: 999.98px) {
  .hero__title { font-size: clamp(40px, 8.62vw - 26.2px, 60px); }
}
.hero__photo {
  position: relative;
  flex: 0 1 480px;
  aspect-ratio: 480 / 610;            /* Figma 46:965: gradient panel 480×610 */
  border-radius: var(--radius-photo);
  background: linear-gradient(180deg, rgb(230 230 230 / 0.66), rgb(211 211 211 / 0.66));
}
.hero__photo img {                    /* Figma 46:966: 472×586 at (3.84, 22.67) inside the panel */
  position: absolute;
  left: 0.8%;
  top: 3.716%;
  width: 98.34%;
  height: 96.05%;
  object-fit: cover;
  border-radius: var(--radius-photo);
}

/* Projects (46:967) */
.projects { padding: 80px 0 110px; }
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px 16px;
  margin-top: 32px;
  align-items: start;
}
@media (max-width: 899.98px) {
  .projects__grid { grid-template-columns: minmax(0, 1fr); }
}

.card { display: flex; flex-direction: column; gap: 24px; }
.card__cover {
  aspect-ratio: 616 / 370;
  overflow: hidden;
  border-radius: var(--radius-cover);
  background: var(--surface-white);
}
.card__cover picture { display: contents; }
.card__cover img { width: 100%; height: 100%; object-fit: cover; }
.card__caption { display: flex; flex-direction: column; gap: 16px; }
.card__head { display: flex; align-items: baseline; gap: 16px; }
.card__title { flex: 1; color: var(--text-on-dark); }
.card__year { color: var(--text-on-dark-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 25%, transparent);
  border-radius: var(--radius-pill);
  color: var(--text-on-dark-muted);
}
.card__highlight {
  max-width: 520px;
  padding-left: 14px; /* 2px bar + 12px gap */
  border-left: 2px solid var(--text-on-dark);
  color: var(--text-on-dark);
}
.card__text { max-width: 520px; color: var(--text-on-dark-muted); }

/* "See more of my work on Behance": its own row under the 2×2 grid (286:398), same gap as between card rows */
.behance { margin-top: 56px; }
.behance a {
  display: block;
  max-width: 463px;
  font: 400 44px/1.2 var(--font);
  color: var(--text-on-dark-display);
}
/* The arrow is part of the text: it always follows the last word ("Behance" + icon never wrap apart)
   and is centred on that line. The icon box has ~4px of empty space on the left, so the visible gap is 8px. */
.behance__last { white-space: nowrap; }
.behance .icon {
  display: inline-block;
  width: 0.955em;  /* 42px at 44px (Figma 46:976), 26.7px at 28px (Figma 59:233) */
  height: 0.955em;
  margin-left: calc(8px - 0.081em);
  vertical-align: -0.103em;
}

/* About me (46:979) */
.about { padding: 80px 0 110px; }
.about__content { display: flex; flex-direction: column; gap: 32px; }
.about__intro {
  display: flex;
  gap: 80px;
  padding-bottom: 16px;
}
/* 560px column as in Figma, plus 2px of room taken back from the gap: the browser's Inter is a hair wider than
   Figma's, and "The last four as lead designer" would otherwise drop "designer" to a 5th line. Story stays at 740. */
.about__statement { flex: 0 1 562px; margin-right: -2px; color: var(--text-heading-grey); }
.about__story {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--text-body);
}
.about__story strong { font-weight: 500; }
.about__divider {
  height: 1px;
  border: 0;
  background: color-mix(in srgb, var(--text-primary) 12%, transparent);
}
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 16px;
}
.facts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fact { display: flex; flex-direction: column; gap: 8px; }
.fact dt { color: var(--text-muted); }
.fact dd { margin: 0; color: var(--text-primary); }

/* Contact (46:1021) */
.contact { padding: 80px 0 120px; }
.contact__row {
  display: flex;
  align-items: flex-start;
  gap: 80px;
  margin-top: 32px;
}
.contact__intro {
  flex: 0 1 560px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.contact__title { max-width: 560px; font: 400 44px/1.2 var(--font); color: var(--text-on-dark-display); }
.contact-links li { border-top: 1px solid color-mix(in srgb, var(--text-on-dark) 15%, transparent); }
.contact-links li:last-child { border-bottom: 1px solid color-mix(in srgb, var(--text-on-dark) 15%, transparent); }
.contact-links a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}
.contact-links__label {
  flex: 0 0 120px;
  color: color-mix(in srgb, var(--text-on-dark-muted) 60%, transparent);
}
.contact-links__value { flex: 1; color: var(--text-on-dark); }
.contact-links .icon { width: 20px; height: 20px; color: var(--text-on-dark); }
.contact__meta-mobile { display: none; }
.contact__meta {
  color: color-mix(in srgb, var(--text-on-dark-muted) 60%, transparent);
  --divider-h: 13px;
  --divider-color: color-mix(in srgb, var(--text-on-dark-muted) 30%, transparent);
}

/* Form panel: default state only; behaviour and other states in stage 7 */
.form {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding: 40px;
  border-radius: var(--radius-panel);
  background: color-mix(in srgb, var(--text-on-dark) 4%, transparent);
}
.form__pair { display: flex; gap: 16px; width: 100%; }
.field { flex: 1; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.field label { color: color-mix(in srgb, var(--text-on-dark-muted) 70%, transparent); }
.field input,
.field textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 20%, transparent);
  border-radius: var(--radius-input);
  background: transparent;
  color: var(--text-on-dark);
  font: 400 16px/normal var(--font); /* Label/16 Regular */
}
.field input { height: 53px; }
.field textarea { height: 160px; resize: none; }
.field ::placeholder { color: color-mix(in srgb, var(--text-on-dark) 35%, transparent); opacity: 1; }
.form-wrap { flex: 1; min-width: 0; }
.form[hidden], .form-done[hidden], .form__failed[hidden], .field__error[hidden] { display: none; }
.form { width: 100%; }

/* Field states (Figma 54:280): focus = brighter border and label; error = red border + message */
.field input, .field textarea { transition: border-color 300ms ease-out; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--text-on-dark) 80%, transparent);
}
.field:focus-within label { color: var(--text-on-dark); }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--state-error); }
.field__error { font: 400 13px/normal var(--font); color: var(--state-error); } /* Caption/13 */

/* Send failed banner (54:346), above the button */
.form__failed {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-input);
  background: color-mix(in srgb, var(--state-error) 20%, transparent);
  font: 400 14px/1.35 var(--font); /* Caption/14 */
  color: var(--text-on-dark);
}
.form__failed a { text-decoration: underline; text-underline-offset: 2px; }
/* Sending (54:323): "Sending…", no icon, not clickable */
.form__submit[aria-busy="true"] { cursor: progress; }
.form__submit[aria-busy="true"] .icon { display: none; }
.form__submit:disabled { pointer-events: none; }

/* Success panel (54:338): replaces the form */
.form-done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 40px;
  border-radius: var(--radius-panel);
  background: color-mix(in srgb, var(--text-on-dark) 4%, transparent);
}
.form-done[hidden] { display: none; }
.form-done:focus { outline: none; }
.form-done__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--state-success);
  border-radius: 50%;
  color: var(--state-success);
}
.form-done__icon svg { width: 22px; height: 22px; }
.form-done__title { font: 400 28px/normal var(--font); color: var(--text-on-dark); }
.form-done__text { font: 400 16px/normal var(--font); color: var(--text-on-dark-muted); }
.form-done__again { font: 500 16px/normal var(--font); color: var(--text-on-dark); }
.form-done__again:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Below 1120px two columns leave the form under 400px wide, so it goes under the contacts */
@media (max-width: 1119.98px) {
  .contact__row { flex-direction: column; gap: 48px; }
  .contact__intro, .form-wrap { flex: none; width: 100%; }
}

/* ---------- Mobile, below 768px (Figma 59:157) ---------- */
@media (max-width: 767.98px) {
  .section-label { font-size: 14px; } /* Caption/14 */

  /* Hero 59:163 */
  .hero__row { flex-direction: column; align-items: stretch; gap: 24px; }
  .hero__text { flex: none; gap: 24px; }
  .hero__tags {
    font-size: clamp(11px, 3.35vw, 12px); /* Caption/12; down to 11px if 12px does not fit */
    column-gap: 10px;
    --divider-h: 11px;
  }
  .hero__tags > li + li::before { margin-right: 10px; }
  .hero__title { font-size: 36px; line-height: 1.15; }
  .hero__photo { flex: none; aspect-ratio: 350 / 434; border-radius: var(--radius-panel); background: none; }
  .hero__photo picture { display: contents; }
  .hero__photo img { position: static; width: 100%; height: 100%; aspect-ratio: auto; border-radius: var(--radius-panel); }

  /* Projects 59:179 */
  .projects { padding: 72px 0; }
  .projects__grid { margin-top: 48px; gap: 48px; }
  .card { gap: 16px; }
  .card__caption { gap: 16px; }
  .card__head { gap: 12px; }
  .card__title { font-size: 22px; }      /* Heading/22 Medium */
  .card__year { font-size: 13px; }       /* Caption/13 */
  .card__highlight, .card__text { font-size: 15px; } /* Body/15 */
  .behance { margin-top: 48px; }
  .behance a { max-width: 290px; font-size: 28px; } /* text box 280px in Figma 59:232; Inter in the browser is ~1% wider */

  /* About 59:504 */
  .about { padding: 72px 0; }
  .about__content { gap: 28px; }
  .about__intro { flex-direction: column; gap: 28px; padding-bottom: 0; }
  .about__statement { flex: none; margin-right: 0; font-size: 28px; } /* Heading/28 120% */
  .about__story { gap: 16px; font-size: 15px; }      /* Body/15 */
  .about__story .btn-row { margin-top: 12px; }       /* 28px from the text, as in Figma */
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .facts--2 { grid-template-columns: minmax(0, 1fr); }
  .fact { gap: 6px; }
  .fact dt { font-size: 12px; } /* Caption/12 */
  .fact dd { font-size: 15px; } /* Body/15 */

  /* Contact 59:544 */
  .contact { padding: 72px 0 48px; }
  .contact__row { margin-top: 32px; gap: 32px; }
  .contact__intro { gap: 32px; }
  .contact__title { font-size: 32px; } /* Heading/32 120% */
  .contact-links a {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 4px;
    padding: 16px 0;
  }
  .contact-links__label { grid-column: 1; font-size: 12px; } /* Caption/12 */
  .contact-links__value { grid-column: 1; font-size: 16px; overflow-wrap: anywhere; }
  .contact-links .icon { grid-column: 2; grid-row: 1 / span 2; }
  .contact__meta { display: none; }
  .contact__meta-mobile {
    display: block;
    font: 400 13px/1.5 var(--font);
    color: color-mix(in srgb, var(--text-on-dark-muted) 60%, transparent);
  }
  .form { padding: 20px; gap: 20px; }
  .form__pair { flex-direction: column; gap: 20px; }
  .field label { font-size: 13px; }
  .field input { height: 49px; padding: 14px; }
  .field textarea { height: 140px; padding: 14px; }
  .form .btn { width: 100%; height: 47px; }
  .form-done { padding: 20px; }
  .form-done__title { font-size: 22px; }
}
