/* ==========================================================================
   S. Çağrı Öztoksoy — redesign
   Neue Haas Grotesk · single-screen home · About page · colour-hover mechanic
   ========================================================================== */
@import url("/assets/fonts/nhg.css");

:root {
  /* base (home) palette */
  --home-bg: #a8a7ac;
  --ink: #16161a;
  --ink-soft: #33343a;
  --line: rgba(20, 20, 24, 0.22);

  /* section gradients (home hover previews + inner-page backgrounds) */
  --grad-about:  linear-gradient(150deg, #5f9bef 0%, #4079e2 60%, #3b72db 100%);
  --grad-life:   linear-gradient(155deg, #70e68c 0%, #5ca3d5 100%);
  --grad-exec:   linear-gradient(165deg, #c65789 0%, #70e68c 100%);
  --grad-awards: linear-gradient(150deg, #8552c8 0%, #a370c2 100%);

  --header-h: 66px;
  --pad-x: clamp(24px, 6.5vw, 150px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t: 0.55s var(--ease);

  --font: "Neue Haas Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--home-bg);
  scrollbar-gutter: stable;   /* keep the right edge identical on scrolling & locked pages */
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: transparent;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: color var(--t);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- colour-hover background stack ---------- */
.bg-stack { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg-layer { position: absolute; inset: 0; opacity: 0; transition: opacity var(--t); will-change: opacity; }
.bg-layer--about  { background: var(--grad-about); }
.bg-layer--life   { background: var(--grad-life); }
.bg-layer--exec   { background: var(--grad-exec); }
.bg-layer--awards { background: var(--grad-awards); }

body.hue-about  .bg-layer--about  { opacity: 1; }
body.hue-life   .bg-layer--life   { opacity: 1; }
body.hue-exec   .bg-layer--exec   { opacity: 1; }
body.hue-awards .bg-layer--awards { opacity: 1; }

/* light ink whenever a colour is active (hover) or on a coloured page */
body.is-hued,
body.page-about, body.page-life, body.page-exec, body.page-awards {
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.86);
  --line: rgba(255, 255, 255, 0.28);
}
body.page-about  .bg-layer--about  { opacity: 1; }
body.page-life   .bg-layer--life   { opacity: 1; }
body.page-exec   .bg-layer--exec   { opacity: 1; }
body.page-awards .bg-layer--awards { opacity: 1; }

/* ---------- fixed header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 var(--pad-x);
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}
/* header underline inset from the page edges by the page padding */
.site-header::after {
  content: "";
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: 0;
  height: 1px;
  background: var(--line);
  transition: background-color var(--t);
}
/* on scroll, frost the header so content passing under it stays legible */
body.scrolled .site-header {
  background: rgba(10, 14, 22, 0.20);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}
.brand {
  font-weight: 500;
  font-size: clamp(15px, 1.28vw, 18px);
  letter-spacing: 0;
  white-space: nowrap;
  transition: color var(--t), opacity 0.25s ease;
}
.brand:hover { opacity: 0.7; }

.header-right { display: flex; align-items: center; gap: clamp(16px, 1.8vw, 24px); }
.social { display: flex; align-items: center; gap: clamp(15px, 1.6vw, 21px); }
.social__ico {
  display: inline-block;
  height: 20px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  transition: opacity 0.25s ease, background-color var(--t);
}
.social__ico:hover { opacity: 0.6; }
.social__ico--ig   { width: 20px; -webkit-mask-image: url("/assets/icons/instagram.png"); mask-image: url("/assets/icons/instagram.png"); }
.social__ico--in   { width: 21px; -webkit-mask-image: url("/assets/icons/linkedin.png");  mask-image: url("/assets/icons/linkedin.png"); }
.social__ico--mail { width: 26px; -webkit-mask-image: url("/assets/icons/email.png");     mask-image: url("/assets/icons/email.png"); }

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 31px;
  height: 31px;
  transition: opacity 0.25s ease;
}
.menu-toggle:hover { opacity: 0.6; }
.menu-toggle span {
  display: block;
  height: 1.7px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--t), opacity 0.3s ease;
}
body.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7.7px) rotate(45deg); }
body.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7.7px) rotate(-45deg); }

/* ---------- home hero ---------- */
body.is-home { overflow-x: hidden; }
.home {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);   /* photo 50% / text 50% */
  grid-template-rows: auto auto;
  grid-template-areas:
    "portrait info"
    "portrait links";
  align-content: start;          /* content sits at the top — PC-like top/bottom space */
  column-gap: clamp(24px, 4vw, 64px);
  row-gap: clamp(14px, 2vw, 26px);
  padding: calc(var(--header-h) + clamp(16px, 2.4vw, 34px)) var(--pad-x) clamp(24px, 3vw, 44px);
}

.home__portrait {
  grid-area: portrait;
  position: relative;
  align-self: start;
  justify-self: start;
  aspect-ratio: 1 / 1;
  width: 100%;
  /* stay square yet never taller than the viewport, so the page never scrolls */
  max-width: calc(100dvh - var(--header-h) - clamp(16px, 2.4vw, 34px) - clamp(24px, 3vw, 44px));
  border-radius: 4px;
  overflow: hidden;
  background: #d9dadd;
}
.home__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}

.home__info { grid-area: info; align-self: start; display: flex; flex-direction: column; min-width: 0; }
.home__name {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
  font-size: clamp(46px, 7.7vw, 130px);
}
.home__name span { display: block; }
.home__role {
  margin-top: clamp(20px, 2.5vw, 34px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 1.4;
  font-size: clamp(15px, 1.45vw, 20px);
  max-width: 34ch;
}
.home__tagline {
  margin-top: clamp(12px, 1.35vw, 18px);
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.5;
  font-size: clamp(16px, 1.45vw, 20px);
  max-width: 46ch;
  transition: color var(--t);
}
.home__links {
  grid-area: links;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;   /* left-aligned under the text, close to the photo */
  gap: clamp(9px, 1vw, 15px);
  padding-top: clamp(20px, 3vw, 40px);
  font-weight: 500;
  font-size: clamp(15px, 1.4vw, 20px);
}
.home__links .sep { opacity: 0.45; user-select: none; }
.home-only { display: none; }   /* "Home" link shows on phones only */
.home__links a { position: relative; padding-bottom: 3px; }
.home__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.home__links a:hover::after,
.home__links a:focus-visible::after { transform: scaleX(1); }

/* ---------- inner content pages ---------- */
.page {
  min-height: 100dvh;
  padding: calc(var(--header-h) + clamp(26px, 4vw, 56px)) var(--pad-x) clamp(44px, 6vw, 88px);
}
.page-title {
  font-weight: 700;
  font-size: clamp(52px, 9vw, 132px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: clamp(26px, 4vw, 60px);
}

/* About — heading stays white; statement + body are dark (per design) */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(28px, 4.5vw, 84px);
  align-items: start;
}
.about-statement {
  font-weight: 700;
  color: #0e1626;
  text-transform: uppercase;
  font-size: clamp(18px, 1.84vw, 26.5px);   /* +5% */
  line-height: 1.43;                          /* +10% leading */
  letter-spacing: 0;
  max-width: 25ch;
}
/* right column runs to the right page margin (mirrors the left), then wraps */
.about-body { display: flex; flex-direction: column; gap: clamp(15px, 1.7vw, 24px); }
.about-body p { font-weight: 500; color: #0e1626; font-size: clamp(17.5px, 1.45vw, 21.5px); line-height: 1.55; }

/* ---------- Life page ---------- */
body.page-life {
  background: var(--grad-life);
}
.life-title {
  font-weight: 700;
  color: #0e1626;
  text-transform: uppercase;
  font-size: clamp(20px, 2.05vw, 30px);
  line-height: 1.2;
  letter-spacing: 0;
}
.life-section { margin-top: clamp(46px, 7vw, 108px); }
.life-intro { margin-top: clamp(6px, 1.5vw, 18px); }
.life-photo { border-radius: 4px; overflow: hidden; align-self: start; }
.life-photo img { width: 100%; height: auto; display: block; }
.life-intro__text { display: flex; flex-direction: column; gap: clamp(16px, 2vw, 26px); }
.life-intro__text .about-statement { max-width: none; }   /* run the blueprint statement to the line end */

.life-spheres { margin-top: clamp(46px, 7vw, 108px); }
.life-spheres__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "intro photos"
    "subs  photos";
  column-gap: clamp(30px, 5vw, 88px);
  row-gap: clamp(24px, 3.5vw, 44px);
  align-items: start;
}
.life-spheres__intro { grid-area: intro; display: flex; flex-direction: column; gap: clamp(14px, 1.8vw, 22px); }
.life-spheres__intro .life-title { margin-bottom: clamp(2px, 0.6vw, 8px); }
.life-spheres__photos { grid-area: photos; }
.life-spheres__subs { grid-area: subs; }
.life-sub strong { display: block; font-weight: 700; margin-bottom: 3px; }
.life-spheres__photos { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 1.5vw, 18px); }
.life-spheres__photos img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; display: block; aspect-ratio: 3 / 4; }
.life-spheres__photos .span2 { grid-column: 1 / -1; aspect-ratio: 16 / 10; }

@media (max-width: 900px) {
  .life-spheres__grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "photos"
      "subs";
    gap: clamp(22px, 5vw, 34px);
  }
}

/* ---------- Executive Profile page ---------- */
body.page-exec { background: var(--grad-exec); }
body.page-about { background: #3f7fd6; }   /* fallback behind the animated ::before */

.exec-intro {
  max-width: 64ch;
  margin-top: clamp(6px, 1.5vw, 18px);
  display: flex;
  flex-direction: column;
  gap: clamp(15px, 1.8vw, 24px);
}
.exec-statement {
  font-weight: 700;
  color: #0e1626;
  text-transform: uppercase;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.3;
}
.exec-section { margin-top: clamp(46px, 7vw, 104px); }

.exec-subhead {
  font-weight: 700;
  color: #0e1626;
  font-size: clamp(16px, 1.3vw, 19.5px);
  line-height: 1.4;
  margin-top: clamp(8px, 1.2vw, 18px);
}
.exec-tight { display: flex; flex-direction: column; gap: clamp(4px, 0.5vw, 7px); }
.exec-tight p, .exec-list li {
  font-weight: 500;
  color: #0e1626;
  font-size: clamp(16px, 1.32vw, 19.5px);
  line-height: 1.45;
}
.exec-tight strong { font-weight: 700; }
.exec-list { margin: 0; padding-left: 1.15em; display: flex; flex-direction: column; gap: clamp(5px, 0.7vw, 9px); }

.exec-chrono { margin-top: clamp(52px, 8vw, 120px); }
.exec-chrono__title {
  font-weight: 700;
  color: #0e1626;
  text-transform: uppercase;
  font-size: clamp(23px, 2.9vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: clamp(18px, 2.5vw, 36px);
}
.chrono-list { list-style: none; margin: 0; padding: 0; }
.chrono-item { border-top: 1px solid rgba(10, 14, 22, 0.3); padding: clamp(16px, 2.2vw, 28px) 0; }
.chrono-item:last-child { border-bottom: 1px solid rgba(10, 14, 22, 0.3); }
.chrono-item__head { font-weight: 700; color: #0e1626; font-size: clamp(16px, 1.35vw, 20px); line-height: 1.35; margin-bottom: clamp(6px, 0.8vw, 10px); }
.chrono-item__desc { font-weight: 500; color: #0e1626; font-size: clamp(15px, 1.12vw, 17px); line-height: 1.55; max-width: 70ch; }

/* two/three-column ledger table (latest projects + award lists) */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(18px, 3vw, 56px);
  align-items: start;
  border-top: 1px solid rgba(10, 14, 22, 0.3);
  padding: clamp(13px, 1.7vw, 22px) 0;
}
.ledger > li:last-child { border-bottom: 1px solid rgba(10, 14, 22, 0.3); }
.ledger__term { font-weight: 700; color: #0e1626; font-size: clamp(15px, 1.2vw, 18px); line-height: 1.35; }
.ledger__term--upper { text-transform: uppercase; }
.ledger__desc { font-weight: 500; color: #0e1626; font-size: clamp(14px, 1.05vw, 16.5px); line-height: 1.5; }
.ledger__desc span { display: block; }
/* awards + personal-awards share one aligned 3-column grid with wider gaps */
.ledger--3col > li,
.ledger--awards > li {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(28px, 5vw, 100px);
}
.ledger__place { font-weight: 700; color: #0e1626; text-align: right; white-space: nowrap; }
.ledger--awards > li > :last-child { text-align: right; }   /* project column flush right, like the personal-awards places */

.ledger-note { margin-top: clamp(24px, 3vw, 40px); font-weight: 500; color: #0e1626; font-size: clamp(14px, 1.1vw, 16px); line-height: 1.6; }
.ledger-note a { text-decoration: underline; text-underline-offset: 3px; }

/* "View More" collapse — desktop shows everything; phones collapse to 3 rows */
.view-more {
  display: none;
  margin-top: clamp(20px, 3vw, 30px);
  padding: 11px 26px;
  border: 1px solid rgba(10, 14, 22, 0.45);
  border-radius: 2px;
  background: transparent;
  color: #0e1626;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.view-more:hover { background: rgba(10, 14, 22, 0.07); }
@keyframes revealItem { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .view-more { display: block; width: -moz-fit-content; width: fit-content; margin-left: auto; margin-right: auto; }
  .exec-collapsible:not(.is-open) .chrono-list > .chrono-item:nth-child(n+4),
  .exec-collapsible:not(.is-open) .ledger > li:nth-child(n+4) { display: none; }
  .exec-collapsible:not(.is-open) .ledger-note { display: none; }
  /* fade the revealed rows in when the section opens */
  .exec-collapsible.is-open .chrono-list > .chrono-item:nth-child(n+4),
  .exec-collapsible.is-open .ledger > li:nth-child(n+4) { animation: revealItem 0.42s ease both; }
}

@media (max-width: 640px) {
  .ledger > li, .ledger--3col > li { grid-template-columns: 1fr; gap: 5px; }
  .ledger__place, .ledger--awards > li > :last-child { text-align: left; }
}

/* ---------- Awards page ---------- */
body.page-awards { background: var(--grad-awards); }

/* ---------- animated page backgrounds (inner pages) — legacy granim canvas ---------- */
/* The static body.page-* gradient stays underneath as the no-JS fallback. */
#bg-gradient {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.awards-lead {
  max-width: 72ch;
  margin-top: clamp(6px, 1.5vw, 18px);
  font-weight: 700;
  color: #0e1626;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.4;
}
.awards-section { margin-top: clamp(48px, 7vw, 110px); }
.awards-section__title {
  font-weight: 700;
  color: #0e1626;
  font-size: clamp(24px, 3vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: clamp(18px, 2.5vw, 36px);
}

/* mobile: bump the small body / list text ~12-14% for legibility */
@media (max-width: 600px) {
  .home__role { font-size: 17px; }
  .home__tagline { font-size: 18px; }
  .about-statement, .exec-statement { font-size: 20px; }
  .about-body p { font-size: 19.5px; }
  .exec-subhead, .exec-tight p, .exec-list li { font-size: 18px; }
  .chrono-item__head { font-size: 18px; }
  .chrono-item__desc { font-size: 17px; }
  .ledger__term, .ledger__place { font-size: 17px; }
  .ledger__desc { font-size: 16px; }
  .awards-lead { font-size: 19px; }
}

/* ---------- fullscreen menu overlay ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--header-h) var(--pad-x) 0;
  background: rgba(16, 16, 20, 0);
  backdrop-filter: blur(0);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t), backdrop-filter var(--t), background-color var(--t);
}
body.menu-open .menu { opacity: 1; visibility: visible; background: rgba(15, 15, 19, 0.74); backdrop-filter: blur(10px); }
.menu nav { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: clamp(8px, 1.4vw, 16px); }
.menu nav a {
  color: #fff;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.04;
  font-size: clamp(34px, 6.5vw, 80px);
  width: max-content;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), color 0.25s ease;
}
body.menu-open .menu nav a { opacity: 1; transform: none; }
body.menu-open .menu nav a:nth-child(1) { transition-delay: 0.06s; }
body.menu-open .menu nav a:nth-child(2) { transition-delay: 0.12s; }
body.menu-open .menu nav a:nth-child(3) { transition-delay: 0.18s; }
body.menu-open .menu nav a:nth-child(4) { transition-delay: 0.24s; }
.menu nav a:hover { color: #cfd2d6; }
.menu nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 8px; }

/* ---------- a11y helpers ---------- */
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 8px 14px; background: #16161a; color: #fff; border-radius: 6px;
  transform: translateY(-160%); transition: transform 0.25s ease;
}
.skip-link:focus { transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --header-h: 58px; }
  .about-grid { grid-template-columns: 1fr; gap: clamp(18px, 5vw, 30px); }
  .about-statement { max-width: 42ch; }
}

/* stack the home only on phones; tablet keeps the 50/50 desktop ratio */
@media (max-width: 640px) {
  .home {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
      "name"
      "role"
      "portrait"
      "tagline"
      "links";
    align-content: start;
    row-gap: clamp(15px, 3.4vw, 22px);
  }
  .home__info { display: contents; }              /* promote name/role/tagline to grid items */
  .home__name { grid-area: name; font-size: clamp(40px, 12.5vw, 60px); }
  .home__role { grid-area: role; margin-top: 0; }
  .home__portrait { grid-area: portrait; justify-self: stretch; max-width: none; }
  .home__tagline { grid-area: tagline; margin-top: 0; max-width: none; }
  .home__links {
    grid-area: links;
    align-self: start;
    justify-content: flex-start;
    gap: 5px;                 /* tighter spacing around the "/" separators */
    margin-top: clamp(6px, 2vw, 14px);
    padding-top: clamp(16px, 4vw, 22px);
    border-top: 1px solid var(--line);
  }
  .home-only { display: inline-block; }           /* show the "Home" link */
  .social { display: none; }                       /* nav = brand + hamburger only on phones */
}

/* ---------- menu overlay: divider + social icons (mobile & tablet only) ---------- */
.menu__divider, .menu .menu__social { display: none; }
@media (max-width: 1024px) {
  .menu__divider {
    display: block;
    width: clamp(150px, 26vw, 220px);
    height: 1px;
    background: rgba(255, 255, 255, 0.35);
    margin-top: clamp(10px, 2.4vw, 18px);
  }
  .menu .menu__social {
    display: flex;
    gap: 26px;
    margin-top: clamp(2px, 1vw, 8px);
    color: #fff;
  }
  .menu .menu__social .social__ico { height: 24px; }
  .menu .menu__social .social__ico--ig   { width: 24px; }
  .menu .menu__social .social__ico--in   { width: 25px; }
  .menu .menu__social .social__ico--mail { width: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
