/* ========================================================================
   Polish layer (loaded last)
   One idea runs through it: chiaroscuro, the light-against-shadow of a
   charcoal drawing. Dark sections get a fine charcoal grain, edges stay
   sharp, and the signature from Ghazaleh's own drawings is the logo.
   ======================================================================== */

:root {
  --charcoal: #17181d;
  --charcoal-raised: #1f1d22;
  --chalk: #eef0f1;
  --chalk-muted: #b4b9c0;
  --wine-deep: #79263e;
  --wine-light: #cd8199;
  --hairline-dark: rgba(238, 240, 241, .14);
  --radius: 2px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Charcoal grain on the dark surfaces ---------- */
.projects-gallery-hero::after,
.closing-signal::after,
footer::after,
.facts-row::after,
.contact-hero::after,
.project-sections .project-section-header::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, .045), transparent 55%),
    var(--grain);
  background-size: auto, 220px 220px;
  width: auto;
  height: auto;
  transform: none;
  border: 0;
  border-radius: 0;
  clip-path: none;
  filter: none;
  animation: none;
  opacity: .5;
  mix-blend-mode: soft-light;
}
.project-sections .project-section-header::before {
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
}
.closing-signal, footer, .facts-row, .contact-hero, .project-sections .project-section-header { position: relative; }
.closing-signal > *, footer > *, .contact-hero > * { position: relative; z-index: 1; }

/* ---------- One shape language: sharp, editorial edges ---------- */
.btn-primary, .btn-outline,
.signature-hero .btn-primary, .signature-hero .btn-outline,
.profile-actions .btn-primary, .profile-actions .btn-outline,
.contact-card, .console-shell, .console-browser, .gyne-desktop, .gyne-phone,
.project-select-card, .project-details, .meta-card, .international-note,
.chip, .pill, .project-back, .case-cover, .case-cover-window,
.language-line span, .gallery-item, .gallery-item img,
nav .nav-contact, html[data-theme="light"] nav .nav-contact {
  border-radius: var(--radius) !important;
}

/* ---------- Signature logo ---------- */
nav .nav-signature {
  display: flex;
  align-items: center;
  line-height: 0;
}
nav .nav-signature .signature-mark {
  display: block;
  width: 112px;
  height: 66px;
  margin: -10px 0 -16px;
  background: #f5eee4;
  -webkit-mask: url("assets/signature.svg") no-repeat left center / contain;
          mask: url("assets/signature.svg") no-repeat left center / contain;
  transition: background-color .25s ease;
}
nav .nav-signature:hover .signature-mark { background: var(--wine-light); }
nav .nav-signature:focus-visible { outline: 2px solid var(--wine-light); outline-offset: 6px; }

/* ---------- Theme toggle: a quiet outline icon ---------- */
nav .theme-toggle,
html[data-theme="light"] nav .theme-toggle,
html[data-theme="light"] .theme-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(245, 238, 228, .27);
  border-radius: var(--radius);
  background: transparent;
  color: #f5eee4;
  box-shadow: none;
}
nav .theme-toggle:hover { border-color: var(--wine-light); color: #fff; }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html[data-theme="light"] .theme-toggle .icon-sun,
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Contact link only appears in the nav list on small screens. */
nav .nav-link-contact { display: none; }

/* ---------- Home: facts row ---------- */
.facts-row {
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--charcoal);
  color: var(--chalk);
  border-top: 1px solid var(--hairline-dark);
  border-bottom: 2px solid var(--wine-deep);
  overflow: hidden;
}
.facts-row .fact {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(28px, 3.4vw, 46px) clamp(20px, 2.6vw, 40px);
  border-left: 1px solid var(--hairline-dark);
  color: inherit;
  text-decoration: none;
}
.facts-row .fact:first-child { border-left: 0; }
.facts-row .fact strong {
  font-family: 'Inter', Arial, sans-serif;
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  font-weight: 650;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.facts-row .fact span {
  color: var(--chalk-muted);
  font-size: .92rem;
  line-height: 1.55;
  max-width: 30ch;
}
.facts-row .fact:hover strong,
.facts-row .fact:focus-visible strong {
  text-decoration: underline;
  text-decoration-color: var(--wine-light);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.facts-row .fact:focus-visible { outline: 2px solid var(--wine-light); outline-offset: -6px; }

/* ---------- Home: the closing call to action is a real button ---------- */
.closing-signal a {
  display: inline-flex;
  align-items: center;
  padding: 16px 30px;
  border: 1px solid #a8385a;
  border-radius: var(--radius);
  background: var(--wine-deep);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-transform: none;
  transition: background .25s ease;
}
.closing-signal a:hover { background: #8f2b46; }
.closing-signal a:focus-visible { outline: 2px solid var(--wine-light); outline-offset: 4px; }

/* ---------- Home: feature titles without dashes ---------- */
.console-copy h3 span {
  display: block;
  margin-top: 6px;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: .6em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--wine-light);
}

/* ---------- Home: currently building ---------- */
.now-building {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  padding: clamp(90px, 10vw, 150px) 7%;
  background: var(--editor-paper);
  color: var(--editor-ink);
  border-top: 1px solid var(--editor-rule);
}
.now-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--editor-wine);
  font-size: .95rem;
  font-weight: 600;
}
.now-label::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--editor-wine);
  box-shadow: 0 0 0 5px rgba(122, 31, 54, .14);
}
.now-copy h2 {
  margin-bottom: 26px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: clamp(2.2rem, 4.2vw, 3.8rem);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: 1.02;
  color: var(--editor-ink);
}
.now-copy p {
  max-width: 62ch;
  margin-bottom: 16px;
  color: var(--editor-secondary);
  font-size: 1.04rem;
  line-height: 1.75;
}
.now-copy ul {
  list-style: none;
  margin: 26px 0 30px;
  padding: 0;
  border-top: 1px solid var(--editor-rule);
}
.now-copy li {
  padding: 13px 0 13px 26px;
  position: relative;
  border-bottom: 1px solid var(--editor-rule);
  color: var(--editor-ink);
  font-size: .98rem;
}
.now-copy li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 2px;
  background: var(--editor-wine);
}
.text-link {
  display: inline-block;
  color: var(--editor-wine);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.text-link:hover { text-decoration-thickness: 2px; }
.now-visual {
  margin: 0;
  box-shadow: 16px 16px 0 var(--wine-deep);
  border: 1px solid var(--editor-rule);
  line-height: 0;
}
.now-visual img { width: 100%; height: auto; display: block; }

/* ---------- Projects: index instead of the WORK box ---------- */
.projects-gallery-hero { position: relative; overflow: hidden; }
.projects-index {
  position: relative;
  z-index: 1;
  align-self: end;
  padding: 0 0 6px 28px;
  border-left: 1px solid var(--hairline-dark);
  color: var(--chalk);
}
.projects-index-count {
  margin-bottom: 26px;
  color: var(--chalk-muted);
  font-size: 1rem;
  line-height: 1.6;
}
.projects-index-count strong { color: var(--chalk); font-weight: 650; }
.projects-index ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline-dark); }
.projects-index li { border-bottom: 1px solid var(--hairline-dark); }
.projects-index a {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  padding: 15px 0;
  color: inherit;
  text-decoration: none;
}
.projects-index a span { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; }
.projects-index a small { grid-column: 1; color: var(--chalk-muted); font-size: .84rem; }
.projects-index a time { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--chalk-muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.projects-index a:hover span, .projects-index a:focus-visible span { color: var(--wine-light); }
.projects-index a:focus-visible { outline: 2px solid var(--wine-light); outline-offset: 2px; }
.project-gallery-shell { padding-top: clamp(60px, 7vw, 100px); }

/* ---------- Case studies: contribution visible, detail folded ---------- */
.project-details summary { cursor: pointer; }

/* ---------- About: a drawing instead of the monogram ---------- */
.about-hero-drawing {
  position: relative;
  z-index: 1;
  align-self: center;
  margin: 0;
  justify-self: center;
  width: min(100%, 280px);
}
.about-hero-drawing img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: cover;
  object-position: center 30%;
  border: 1px solid rgba(238, 240, 241, .2);
  box-shadow: 14px 14px 0 var(--wine-deep);
}
.about-hero-drawing figcaption {
  margin-top: 26px;
  color: #bec2c9;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: .9rem;
  font-style: italic;
}

.skill-habits ul { list-style: none; margin: 0; padding: 0; }
.skill-habits li {
  margin-bottom: 12px;
  color: var(--editor-secondary);
  font-size: .9rem;
  line-height: 1.55;
}
.skill-habits li b { display: block; color: var(--editor-ink); font-weight: 600; }

/* ---------- About: Golden HEROES photos ---------- */
.bip-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 16px;
}
.bip-photos a { display: block; line-height: 0; overflow: hidden; border: 1px solid var(--editor-rule); }
.bip-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .4s ease; }
.bip-photos a:hover img { transform: scale(1.04); }
.bip-photos a:focus-visible { outline: 2px solid var(--editor-wine); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .bip-photos img { transition: none; } }

/* ---------- Contact page ---------- */
.contact-hero {
  padding: clamp(140px, 13vw, 190px) 7% clamp(80px, 9vw, 130px);
  background: var(--charcoal);
  color: var(--chalk);
  overflow: hidden;
}
.contact-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(34vw, 440px);
  height: 58px;
  opacity: .36;
  background: url("assets/lace-edge.svg") repeat-x left top / 160px 58px;
  pointer-events: none;
}
.contact-hero-copy { max-width: 900px; margin-bottom: clamp(48px, 6vw, 80px); }
.contact-hero-copy h1 {
  margin-bottom: 26px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: clamp(3.4rem, 8vw, 8rem);
  font-weight: 650;
  letter-spacing: -.085em;
  line-height: .96;
  color: var(--chalk);
}
.contact-hero-copy h1 em {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: .78em;
  font-weight: 400;
  letter-spacing: -.05em;
  color: #c97990;
}
.contact-hero-copy p { max-width: 58ch; color: var(--chalk-muted); font-size: 1.12rem; line-height: 1.7; }

.contact-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  border: 1px solid var(--hairline-dark);
  border-top: 2px solid var(--wine-deep);
  background: rgba(31, 29, 34, .78);
}
.contact-sheet-main { padding: clamp(28px, 4vw, 56px); border-right: 1px solid var(--hairline-dark); }
.contact-sheet-label { margin-bottom: 12px; color: var(--chalk-muted); font-size: .95rem; }
.contact-email {
  display: inline-block;
  margin-bottom: 30px;
  color: var(--chalk);
  font-size: clamp(1.4rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: rgba(205, 129, 153, .55);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}
.contact-email:hover { text-decoration-color: var(--wine-light); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-actions .btn-primary,
.contact-actions .btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 14px 24px;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}
.contact-actions .btn-primary { background: var(--wine-deep); border: 1px solid #8f2b46; color: #fff; }
.contact-actions .btn-primary:hover { background: #8f2b46; }
.contact-actions .btn-outline { background: transparent; border: 1px solid rgba(238, 240, 241, .35); color: var(--chalk); }
.contact-actions .btn-outline:hover { border-color: var(--chalk); }
.copy-status { min-height: 1.5em; margin: 12px 0 18px; color: var(--wine-light); font-size: .9rem; }
.contact-profiles { display: flex; flex-wrap: wrap; gap: 8px 28px; list-style: none; margin: 0; padding: 0; }
.contact-profiles a {
  color: var(--chalk);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(238, 240, 241, .3);
  text-underline-offset: 5px;
}
.contact-profiles a:hover { text-decoration-color: var(--wine-light); }

.contact-availability { margin: 0; padding: clamp(18px, 3vw, 40px) clamp(24px, 3.4vw, 48px); }
.contact-availability div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--hairline-dark);
}
.contact-availability div:last-child { border-bottom: 0; }
.contact-availability dt { color: var(--chalk-muted); font-size: .9rem; }
.contact-availability dd { margin: 0; color: var(--chalk); font-weight: 500; }

.contact-brief {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
  padding: clamp(80px, 9vw, 130px) 7%;
  background: var(--editor-paper);
  color: var(--editor-ink);
}
.contact-drawing { margin: 0; }
.contact-drawing img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--editor-rule);
  box-shadow: 14px 14px 0 var(--wine-deep);
}
.contact-brief h2 {
  margin-bottom: 24px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  font-weight: 650;
  letter-spacing: -.05em;
  line-height: 1.05;
  color: var(--editor-ink);
}
.contact-brief ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--editor-rule); max-width: 64ch; }
.contact-brief li {
  position: relative;
  padding: 16px 0 16px 26px;
  border-bottom: 1px solid var(--editor-rule);
  color: var(--editor-secondary);
  font-size: 1.02rem;
  line-height: 1.6;
}
.contact-brief li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.65em;
  width: 12px;
  height: 2px;
  background: var(--editor-wine);
}

/* ---------- Footer wraps instead of overflowing ---------- */
footer { overflow: hidden; }
.footer-links { flex-wrap: wrap; gap: 10px 22px; }

/* ---------- Layout fixes ---------- */
.console-shell > * { min-width: 0; }

@media (max-width: 1100px) {
  .facts-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-row .fact:nth-child(3) { border-left: 0; }
  .facts-row .fact:nth-child(n + 3) { border-top: 1px solid var(--hairline-dark); }
  .now-building { grid-template-columns: 1fr; }
  .now-visual { max-width: 640px; }
  .contact-sheet { grid-template-columns: 1fr; }
  .contact-sheet-main { border-right: 0; border-bottom: 1px solid var(--hairline-dark); }
}

@media (max-width: 720px) {
  nav .nav-signature .signature-mark { width: 82px; height: 48px; margin: -6px 0 -10px; }
  nav .nav-links li:first-child { display: none; }
  nav .nav-link-contact { display: list-item; }
  nav .theme-toggle, html[data-theme="light"] nav .theme-toggle { width: 36px; height: 36px; }

  .stage-caption { display: none; }

  .console-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    overflow: hidden !important;
  }
  .console-tab { min-width: 0 !important; padding: 16px 10px !important; }
  .console-tab > span, .console-tab small { display: none; }
  .console-tab strong { font-size: .92rem; overflow-wrap: normal; word-break: normal; }
  .console-heading h2 { font-size: clamp(2.6rem, 12.5vw, 4.4rem) !important; }
  .contact-email { font-size: clamp(1.05rem, 5.4vw, 1.6rem); }
  .about-hero-drawing figcaption { color: var(--editor-secondary); }
  .console-shell { margin-left: 0 !important; margin-right: 0 !important; }

  .facts-row { grid-template-columns: 1fr; }
  .facts-row .fact { border-left: 0; border-top: 1px solid var(--hairline-dark); padding: 24px 6%; }
  .facts-row .fact:first-child { border-top: 0; }

  .now-building { padding: 80px 6%; }
  .now-visual { box-shadow: 10px 10px 0 var(--wine-deep); }

  .projects-gallery-hero .projects-index {
    display: block;
    padding: 28px 0 0;
    border-left: 0;
    border-top: 1px solid var(--hairline-dark);
  }

  .about-hero-drawing { justify-self: start; width: min(62%, 240px); margin-top: 8px; }
  .about-hero-drawing img { box-shadow: 10px 10px 0 var(--wine-deep); }

  footer { flex-direction: column; align-items: flex-start; gap: 16px; }

  .contact-availability div { grid-template-columns: 1fr; gap: 4px; }
  .contact-brief { grid-template-columns: 1fr; padding: 70px 6%; }
  .contact-drawing { max-width: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  nav .nav-signature .signature-mark { transition: none; }
}
