:root {
  --bg: #ffffff;
  --bg-2: #f4f5f7;
  --ink: #0f1115;
  --ink-2: #3a3f47;
  --muted: #6b717c;
  --line: #e4e6ea;
  --accent: #2b5fd9;
  --head: "Manrope", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --wrap: 1200px;
  --r: 12px;
  --shadow: 0 1px 2px rgba(15, 17, 21, .04), 0 12px 32px -12px rgba(15, 17, 21, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -.02em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.is-scrolled { border-color: var(--line); }
.nav__inner { display: flex; justify-content: space-between; align-items: center; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 16px/1 var(--head); text-decoration: none; }
.brand__mark { width: 30px; height: 30px; border-radius: 7px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.nav__links { display: flex; align-items: center; gap: 32px; font-size: 15px; }
.nav__links a { white-space: nowrap; color: var(--muted); text-decoration: none; transition: color .15s; }
.nav__links a:hover { color: var(--ink); }
.nav__links .nav__cta { color: var(--ink); border: 1px solid var(--line); padding: 8px 16px; border-radius: 8px; }
.nav__links .nav__cta:hover { border-color: var(--ink); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 64px; align-items: end; padding-top: 112px; padding-bottom: 112px; }
.hero h1 { font-size: clamp(44px, 6.4vw, 80px); font-weight: 700; line-height: 1; letter-spacing: -.035em; }
.hero__role { font: 500 clamp(20px, 2.2vw, 26px)/1.2 var(--head); color: var(--muted); margin: 14px 0 28px; }
.hero__lede { font-size: 18px; color: var(--ink-2); max-width: 560px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.btn { display: inline-block; background: var(--ink); color: #fff; text-decoration: none; font: 500 15px/1 var(--body); padding: 14px 22px; border-radius: 8px; border: 1px solid var(--ink); transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn--quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--quiet:hover { border-color: var(--ink); opacity: 1; }
.hero__facts { margin: 0; border-top: 1px solid var(--line); }
.hero__facts div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hero__facts dt { color: var(--muted); }
.hero__facts dd { margin: 0; }

/* Case studies */
.case { padding: 0 0 128px; }
.case__hero { position: relative; border-radius: var(--r); overflow: hidden; background: var(--bg-2); box-shadow: var(--shadow); }
.case__hero > img { width: 100%; height: auto; }
.frame { border: 1px solid var(--line); margin: 0; }
.frame__bar { height: 34px; background: var(--bg-2); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 7px; padding: 0 14px; }
.frame__bar span { width: 10px; height: 10px; border-radius: 50%; background: #d5d8de; }
.case__strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.case__strip img { aspect-ratio: 16 / 9; object-fit: cover; object-position: top left; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; transition: transform .25s ease; }
.case__strip img:hover { transform: translateY(-2px); }
.case__body { display: grid; grid-template-columns: 1fr 1.4fr; gap: 64px; margin-top: 48px; }
.case__kicker { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.case h2 { font-size: clamp(30px, 3.4vw, 42px); font-weight: 700; line-height: 1.1; }
.case__copy p { color: var(--ink-2); font-size: 17px; }
.tags { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 13px; color: var(--ink-2); background: var(--bg-2); border-radius: 6px; padding: 5px 10px; }
.link { display: inline-block; margin-top: 20px; font-weight: 500; font-size: 15px; color: var(--accent); text-decoration: none; }
.link::after { content: " →"; }
.link:hover { text-decoration: underline; }

/* Doors player */
.player { aspect-ratio: 16 / 9; background: var(--ink); }
.player__poster { width: 100%; height: 100%; object-fit: cover; }
.player__btn { position: absolute; left: 24px; bottom: 24px; background: #fff; color: var(--ink); border: 0; border-radius: 8px; padding: 13px 20px 13px 40px; font: 500 15px/1 var(--body); cursor: pointer; box-shadow: var(--shadow); }
.player__btn::before { content: ""; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-left: 10px solid var(--ink); border-right: 0; }
.player__btn:hover { background: var(--bg-2); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Tiger's Tale phones */
.phones { height: clamp(300px, 52vw, 660px); display: flex; align-items: center; justify-content: center; gap: 4%; padding: 4% 6%; background: url("assets/img/tt-screen.jpg") center 70% / cover, #bfe0f6; }
.phone { height: 100%; width: auto; min-width: 0; object-fit: contain; border-radius: 22px; border: 6px solid #0f1115; box-shadow: 0 20px 40px -16px rgba(15, 17, 21, .45); background: #fff; }
.phone--card { height: 88%; border-radius: 16px; }
.phone--art { height: 72%; border-radius: 16px; border-color: #fff; }

/* Other projects */
.more { padding-bottom: 128px; }
.section-title { font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 32px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 20px; }
.tile { text-decoration: none; }
.tile img { aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 16px; transition: transform .25s ease; }
.tile:hover img { transform: translateY(-3px); }
.tile h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.tile p { font-size: 14px; color: var(--muted); margin: 0; }

/* Experience */
.band { background: var(--bg-2); padding: 112px 0; }
.exp { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.exp li { display: grid; grid-template-columns: 1.4fr 1fr 120px; gap: 24px; padding: 22px 28px; border-bottom: 1px solid var(--line); align-items: baseline; }
.exp li:last-child { border-bottom: 0; }
.exp__role { font: 600 17px/1.35 var(--head); }
.exp__org { color: var(--ink-2); font-size: 15px; }
.exp__when { color: var(--muted); font-size: 14px; text-align: right; }

/* About */
.about { display: grid; grid-template-columns: 1fr 1.3fr; gap: 80px; padding-top: 112px; padding-bottom: 112px; }
.about__text { font: 500 clamp(22px, 2.4vw, 28px)/1.4 var(--head); letter-spacing: -.01em; }
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.skillset { border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.skillset h3 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.skillset ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.skillset li { font-size: 14px; background: var(--bg-2); border-radius: 6px; padding: 5px 10px; }

/* Contact */
.contact { background: var(--ink); color: #fff; padding: 112px 0; }
.contact__inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.contact h2 { font-size: clamp(36px, 5vw, 56px); font-weight: 700; margin-bottom: 16px; }
.contact__email { font-size: clamp(18px, 2vw, 22px); color: #c9d6f7; text-decoration: none; word-break: break-all; }
.contact__email:hover { text-decoration: underline; }
.contact__links { list-style: none; padding: 0; margin: 0; display: flex; gap: 28px; flex-wrap: wrap; }
.contact__links a { color: #a7adb8; text-decoration: none; font-size: 15px; }
.contact__links a:hover { color: #fff; }
.footer { background: var(--ink); color: #6b717c; font-size: 13px; padding: 0 0 40px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(15, 17, 21, .88); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-height: 90vh; border-radius: 8px; }

.fade { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.fade.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .fade { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .nav__links { gap: 20px; font-size: 14px; }
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 72px; padding-bottom: 80px; }
  .case__body { grid-template-columns: 1fr; gap: 16px; margin-top: 32px; }
  .case { padding-bottom: 96px; }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .project__body { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav__links { gap: 16px; font-size: 14px; }
  .nav__links a[href$="#experience"], .nav__links a[href$="#about"], .nav__links a[href$="#work"] { display: none; }
  .brand { font-size: 15px; }
  .case__strip { gap: 8px; margin-top: 8px; }
  .phones { height: 300px; gap: 3%; padding: 5% 4%; }
  .phone { border-width: 4px; border-radius: 14px; }
  .skills { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; gap: 24px 12px; }
  .challenges li { grid-template-columns: 1fr; gap: 4px; }
  .exp li { grid-template-columns: 1fr; gap: 2px; padding: 18px 20px; }
  .exp__when { text-align: left; }
  .band, .contact { padding: 72px 0; }
  .about { padding-top: 72px; padding-bottom: 72px; }
  .player__btn { left: 12px; bottom: 12px; }
}

/* Linked heroes and titles */
a.case__hero:not(.phones) { display: block; }
a.case__hero { transition: transform .25s ease; }
a.case__hero:hover { transform: translateY(-3px); }
.case h2 a { text-decoration: none; }
.case h2 a:hover { color: var(--accent); }
.note { font-size: 13px; color: var(--muted); margin-top: 16px; }

/* Text-only tiles */
.tile__text { aspect-ratio: 16 / 10; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 16px; background: var(--bg-2); display: flex; align-items: flex-end; padding: 16px; transition: transform .25s ease; }
.tile__text span { font: 700 20px/1.1 var(--head); letter-spacing: -.02em; color: #b5bac3; }
.tile:hover .tile__text { transform: translateY(-3px); }

/* Contact email */
.email { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.email__text { font-size: clamp(18px, 2vw, 22px); color: #e6eaf2; user-select: all; word-break: break-all; }
.email__copy { background: transparent; color: #c9d6f7; border: 1px solid #39404c; border-radius: 6px; padding: 6px 12px; font: 500 13px/1 var(--body); cursor: pointer; }
.email__copy:hover { border-color: #c9d6f7; }

/* Project page */
.project { padding-top: 40px; padding-bottom: 96px; }
.back { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 40px; }
.back:hover { color: var(--ink); }
.project__head { margin-bottom: 40px; }
.project__head h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; }
.project__body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 64px; margin-top: 56px; }
.project__intro p { font-size: 18px; color: var(--ink-2); }
.project__facts { margin: 0; border-top: 1px solid var(--line); }
.project__facts div { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.project__facts dt { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.project__facts dd { margin: 0; }
.project__facts .link { margin-top: 0; }
.challenges { margin-top: 80px; }
.challenges ol { list-style: none; padding: 0; margin: 0; counter-reset: c; }
.challenges li { counter-increment: c; display: grid; grid-template-columns: 1fr 1.6fr; gap: 64px; padding: 32px 0; border-top: 1px solid var(--line); }
.challenges li:last-child { border-bottom: 1px solid var(--line); }
.challenges h3 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.challenges h3::before { content: counter(c, decimal-leading-zero); display: block; font: 500 13px/1 var(--body); color: var(--muted); margin-bottom: 10px; letter-spacing: 0; }
.challenges p { color: var(--ink-2); font-size: 17px; margin: 0; }
.next { display: block; margin-top: 80px; padding: 32px; border-radius: var(--r); background: var(--bg-2); text-decoration: none; font: 700 clamp(22px, 3vw, 32px)/1.2 var(--head); letter-spacing: -.02em; transition: background .2s; }
.next span { display: block; font: 500 13px/1 var(--body); color: var(--muted); margin-bottom: 10px; letter-spacing: 0; }
.next:hover { background: #eaecef; }
.footer--light { background: transparent; border-top: 1px solid var(--line); padding-top: 24px; }

.nav__links a[aria-current="page"] { color: var(--ink); }

/* Gallery */
.gallery-page { padding-top: 72px; padding-bottom: 96px; }
.page-title { font-size: clamp(36px, 5vw, 56px); font-weight: 700; letter-spacing: -.03em; }
.page-sub { color: var(--muted); font-size: 17px; margin: 12px 0 48px; }
.gallery { columns: 3 240px; column-gap: 16px; }
.shot { position: relative; display: block; margin: 0 0 16px; break-inside: avoid; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.shot img { width: 100%; height: auto; max-height: 520px; object-fit: cover; object-position: top; transition: transform .4s ease; }
.shot__cap { position: absolute; inset: auto 0 0 0; padding: 40px 18px 16px; color: #fff; font-size: 14px; line-height: 1.5; background: linear-gradient(to top, rgba(15,17,21,.88), rgba(15,17,21,0)); opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.shot__cap strong { display: block; font: 600 15px/1.3 var(--head); margin-bottom: 2px; }
.shot:hover .shot__cap, .shot:focus-visible .shot__cap { opacity: 1; transform: none; }
.shot:hover img { transform: scale(1.03); }
@media (hover: none) {
  .shot__cap { position: static; opacity: 1; transform: none; background: #fff; color: var(--ink-2); padding: 12px 14px; }
}

/* Project page: stack columns on smaller screens (kept last so it overrides the base rules above) */
@media (max-width: 900px) {
  .project__body { grid-template-columns: 1fr; gap: 32px; }
  .challenges li { grid-template-columns: 1fr; gap: 8px; }
}
