/* ==========================================================
   Madhu Giridharan — Portfolio
   Colors, fonts and sizes match the Figma "Portfolio redesign"
   ========================================================== */
:root {
  --cream: #F4EDE7;
  --navy: #314254;
  --accent: #597A8D;
  --card: #CBD9E4;
  --rule: #DBD6D1;
  --white: #FFFFFF;

  --font-head: "Poppins", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-hand: "Annie Use Your Telescope", cursive;

  --stage: 1512px;
  --content-left: 376px;   /* where the right column starts */
  --content-right: 32px;
  --topbar: 64px;
  --top-gap: clamp(88px, 12vh, 148px);   /* space above content, under the top bar */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
body {
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  min-width: 1200px;           /* desktop-only on purpose */
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }

.hand { font-family: var(--font-hand); }
.eyebrow { font-family: var(--font-hand); font-size: 26px; color: var(--accent); }
h1 { font-family: var(--font-head); font-weight: 500; font-size: 64px; line-height: 1.15; }
h2 { font-family: var(--font-head); font-weight: 500; font-size: 40px; line-height: 1.2; }
h3 { font-family: var(--font-head); font-weight: 500; font-size: 32px; line-height: 1.25; }
p.body { font-size: 20px; line-height: 1.6; max-width: 760px; }

/* ---------- Page stage ---------- */
.stage { max-width: var(--stage); margin: 0 auto; position: relative; }
main {
  padding: var(--top-gap) var(--content-right) 0 var(--content-left);
  display: flex; flex-direction: column; gap: 110px;
}

/* ---------- Top bar (sticky) ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar); z-index: 50;
  background: rgba(244, 237, 231, 0.82);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.topbar-inner {
  max-width: var(--stage); height: 100%; margin: 0 auto; padding: 0 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.home-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; transition: background .2s; }
.home-btn:hover { background: rgba(49, 66, 84, .08); }
.topbar nav { display: flex; gap: 56px; align-items: center; }
.topbar nav a { position: relative; font-size: 18px; padding: 4px 0; }
.topbar nav a::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 18px; height: 2px;
  background: var(--accent); border-radius: 2px; transform: translateX(-50%) scaleX(0);
  transition: transform .25s ease;
}
.topbar nav a:hover::after, .topbar nav a.active::after { transform: translateX(-50%) scaleX(1); }
.topbar nav a.active, .topbar nav a.resume { font-weight: 700; }

/* ---------- Left sidebar (sticky) ---------- */
.sidebar {
  position: fixed; top: 148px; z-index: 40; width: 280px;
  left: max(32px, calc((100vw - var(--stage)) / 2 + 32px));
}
.sidebar .first { font-family: var(--font-head); font-weight: 500; font-size: 64px; line-height: 1.1; }
.sidebar .last  { font-family: var(--font-head); font-size: 40px; line-height: 1.2; margin-top: -4px; }
.sidebar .tagline { font-size: 24px; line-height: 1.35; margin: 40px 0 44px; max-width: 230px; }
.sidebar .roles { display: flex; flex-direction: column; gap: 22px; }
.sidebar .roles a { display: block; font-size: 20px; line-height: 1.6; }
.sidebar .roles a strong { font-weight: 600; display: block; }
.sidebar .roles a:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.sidebar .clock { margin: 48px 0 56px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px;
  border: 1.5px solid var(--navy); border-radius: 999px; font-size: 16px; font-weight: 600;
  transition: background .2s, color .2s;
}
.pill:hover { background: var(--navy); color: var(--cream); }
.pill.solid { background: var(--navy); color: var(--cream); }
.pill.solid:hover { background: var(--accent); border-color: var(--accent); }

/* ---------- 7-segment coffee clock ---------- */
.clock { display: flex; gap: 7px; align-items: center; cursor: default; position: relative; height: 48px; }
/* Quick tooltip (the browser's own title tooltip is too slow) */
.clock[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 8px);
  background: var(--navy); color: var(--cream); font-size: 14px; line-height: 1; white-space: nowrap;
  padding: 7px 10px; border-radius: 6px; pointer-events: none;
  opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s;
}
.clock[data-tip]:hover::after { opacity: 1; transform: none; transition-delay: .1s; }
.seg-digit { position: relative; width: 22px; height: 40px; }
.seg-digit i { position: absolute; background: var(--navy); border-radius: 2px; opacity: .07; transition: opacity .15s; }
.seg-digit i.on { opacity: 1; }
.seg-digit .a { left: 4px; top: 0;    width: 14px; height: 4px; }
.seg-digit .g { left: 4px; top: 18px; width: 14px; height: 4px; }
.seg-digit .d { left: 4px; bottom: 0; width: 14px; height: 4px; }
.seg-digit .f { left: 0;  top: 4px;  width: 4px; height: 14px; }
.seg-digit .b { right: 0; top: 4px;  width: 4px; height: 14px; }
.seg-digit .e { left: 0;  top: 22px; width: 4px; height: 14px; }
.seg-digit .c { right: 0; top: 22px; width: 4px; height: 14px; }
.seg-colon { width: 4px; height: 40px; position: relative; }
.seg-colon::before, .seg-colon::after { content: ""; position: absolute; left: 0; width: 4px; height: 4px; border-radius: 1px; background: var(--navy); }
.seg-colon::before { top: 10px; } .seg-colon::after { top: 25px; }

/* ---------- Image slots (dashed placeholder until you add the file) ---------- */
.media { position: relative; border-radius: 16px; overflow: hidden; background: var(--card); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media.empty { border: 1.5px dashed var(--accent); display: grid; place-items: center; min-height: 240px; }
.media.empty img, .media.empty video { display: none; }
.media.empty::after { content: attr(data-label); font-family: var(--font-hand); font-size: 26px; color: var(--accent); padding: 16px; text-align: center; }

/* ==========================================================
   HOME — coffee order
   ========================================================== */
/* Hero fits the window: cups + barista cards shrink on shorter screens */
.order { --cup-h: clamp(190px, 30vh, 276px); display: flex; flex-direction: column; gap: clamp(16px, 2.5vh, 36px); }
.cups-card { position: relative; height: calc(var(--cup-h) + 78px); background: var(--card); border-radius: 13px; overflow: hidden; }
.cups-track {
  position: absolute; inset: 0 80px;
  display: flex; align-items: center; gap: 22px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 0 calc(50% - var(--cup-h) * 88 / 276);
}
.cups-track::-webkit-scrollbar { display: none; }
.cup {
  flex: 0 0 calc(var(--cup-h) * 176 / 276); height: var(--cup-h); position: relative; scroll-snap-align: center;
  transform-origin: center 60%; will-change: transform; transition: filter .2s;
}
.cup img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.cup .label {
  position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%);
  width: 52%; text-align: center; font-family: var(--font-hand); font-size: 20px; line-height: 1.3; color: #000;
  pointer-events: none;
}
.cup.center { cursor: pointer; }
.cup.center:hover { filter: drop-shadow(0 8px 14px rgba(49, 66, 84, .18)); }
.cup:not(.center) { cursor: pointer; }
.cup.no-img { border: 1.5px dashed var(--accent); border-radius: 18px 18px 30px 30px; }
.cups-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
  transition: background .2s;
}
.cups-arrow:hover { background: rgba(49, 66, 84, .1); }
.cups-arrow.prev { left: 16px; } .cups-arrow.next { right: 16px; }
.cups-hint { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-family: var(--font-hand); font-size: 22px; color: var(--accent); pointer-events: none; }

.order-row { display: grid; grid-template-columns: 613fr 467fr; gap: 24px; height: clamp(220px, 38vh, 344px); }
.order-card { position: relative; background: var(--card); border-radius: 13px; overflow: hidden; display: grid; place-items: center; }
.order-card img.gif { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .3s; }
.order-card .note { font-family: var(--font-hand); font-size: 32px; text-align: center; padding: 32px; transition: opacity .3s; }
.order-card .msg { position: absolute; left: 32px; top: 80px; width: 250px; font-family: var(--font-hand); font-size: 32px; line-height: 1.25; opacity: 0; transition: opacity .4s .3s; }
.order-card .again { position: absolute; left: 32px; bottom: 24px; font-family: var(--font-hand); font-size: 22px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.order-card .again:hover { text-decoration: underline; }

.order[data-state="making"] .making img.gif,
.order[data-state="giving"] .making img.gif,
.order[data-state="giving"] .giving img.gif { opacity: 1; }
.order[data-state="making"] .making .note,
.order[data-state="giving"] .note { opacity: 0; }
.order[data-state="making"] .giving .note.brewing { opacity: 1 !important; }
.order .giving .note.brewing { position: absolute; opacity: 0; }
.order[data-state="giving"] .msg { opacity: 1; }
.order[data-state="giving"] .again { opacity: .75; pointer-events: auto; }

/* ==========================================================
   HOME — today's menu (project cards)
   ========================================================== */
.menu { display: flex; flex-direction: column; gap: 48px; padding-top: 48px; border-top: 1px solid var(--card); }
.menu-top { display: grid; grid-template-columns: 1fr 736px; gap: 24px; align-items: start; }
.menu-top h2 { font-size: 48px; font-weight: 400; padding-left: 24px; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 58px; }

.pcard { position: relative; display: block; height: 375px; border-radius: 13px; overflow: hidden; background: var(--card); }
.pcard .face, .pcard .back { position: absolute; inset: 0; transition: opacity .25s ease-out; }
.pcard .face { display: grid; place-items: center; padding: 52px 40px; }
.pcard .face img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pcard .face .wordmark { font-family: var(--font-hand); font-size: 96px; line-height: 1; }
.pcard .back {
  opacity: 0; background: var(--navy); color: var(--cream);
  padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.pcard:hover .back, .pcard:focus-visible .back { opacity: 1; }
.pcard .tag { display: inline-block; align-self: flex-start; font-size: 13px; color: var(--card); border: 1px solid var(--card); border-radius: 999px; padding: 5px 12px; }
.pcard .title { font-family: var(--font-hand); font-size: 52px; line-height: 1.1; margin: 12px 0; }
.pcard .desc { font-size: 18px; line-height: 1.5; opacity: .92; }
.pcard .foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.pcard .role small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--card); }
.pcard .role span { font-size: 16px; }
.pcard .cta { font-family: var(--font-hand); font-size: 24px; white-space: nowrap; }
.menu-row .pcard .back { padding: 32px 36px; }
.menu-row .pcard .title { font-size: 44px; }
.menu-row .pcard .desc { font-size: 16px; }

/* ==========================================================
   FOOTERS
   ========================================================== */
.footer-big {
  position: relative; background: var(--navy); color: var(--cream);
  border-radius: 13px 13px 0 0; height: 557px; padding: 64px 56px 40px; overflow: hidden;
}
.footer-big .left { width: 290px; }
.footer-big .left h3 { font-family: var(--font-hand); font-weight: 400; font-size: 48px; line-height: 1.1; }
.footer-big .left p { color: var(--card); font-size: 18px; line-height: 1.5; margin: 16px 0 24px; }
.footer-big .order-btn { display: inline-block; background: var(--cream); color: var(--navy); font-weight: 600; font-size: 16px; padding: 14px 24px; border-radius: 999px; transition: transform .2s; }
.footer-big .order-btn:hover { transform: translateY(-2px); }
.footer-big .shop { position: absolute; left: 380px; top: 87px; width: 399px; }
.footer-big .shop.empty { display: none; }
.footer-big .right { position: absolute; right: 56px; top: 64px; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.footer-big .right .hand { font-size: 26px; }
.footer-big .icons { display: flex; gap: 14px; }
.footer-big .icons a { width: 52px; height: 52px; border-radius: 999px; border: 1.5px solid var(--card); display: grid; place-items: center; transition: background .2s; }
.footer-big .icons a:hover { background: var(--cream); }
.footer-big .icons a:hover svg * { stroke: var(--navy); }
.footer-big .icons a:hover svg path[fill] { fill: var(--navy); }
.footer-big .bottom { position: absolute; left: 56px; right: 56px; bottom: 40px; display: flex; justify-content: space-between; font-size: 14px; color: var(--card); }
.footer-big .bottom a { text-decoration: underline; text-underline-offset: 3px; }
.footer-big .bottom a.plain { text-decoration: none; }

.footer-slim {
  background: var(--navy); color: var(--cream); border-radius: 13px 13px 0 0; height: 96px; padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-slim .eyebrow-link { font-size: 13px; font-weight: 600; letter-spacing: .18em; color: var(--card); }
.footer-slim .links { display: flex; gap: 40px; margin-left: auto; font-size: 18px; }
.footer-slim a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ==========================================================
   CASE STUDY pages (Discover, Deborah 2.0, Cartlyst)
   ========================================================== */
.section-list { position: fixed; top: var(--top-gap); z-index: 40; left: max(48px, calc((100vw - var(--stage)) / 2 + 48px)); display: flex; flex-direction: column; gap: 16px; }
.section-list .back { font-size: 16px; color: var(--accent); margin-bottom: 12px; }
.section-list .back:hover { text-decoration: underline; }
.section-list a.item { display: flex; align-items: center; gap: 14px; font-size: 18px; }
.section-list a.item::before { content: ""; width: 8px; height: 8px; border-radius: 999px; border: 1.2px solid var(--accent); transition: background .2s; }
.section-list a.item.active { font-weight: 600; }
.section-list a.item.active::before { background: var(--navy); border-color: var(--navy); }

.case section { display: flex; flex-direction: column; gap: 24px; }
.case h1 { margin-top: -8px; }
.meta { display: flex; gap: 56px; padding-top: 20px; }
.meta small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; margin-bottom: 6px; }
.stats { display: flex; gap: 72px; padding-top: 12px; }
.stats b { display: block; font-family: var(--font-head); font-weight: 500; font-size: 44px; line-height: 1.2; }
.stats span { font-size: 16px; color: var(--accent); }
.steps { display: flex; flex-direction: column; }
.steps li { list-style: none; display: flex; gap: 24px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--rule); font-size: 20px; line-height: 1.55; }
.steps li .n { font-family: var(--font-hand); font-size: 32px; color: var(--accent); min-width: 24px; }
.steps.labelled li .n { min-width: 160px; font-size: 28px; }
.case .media { height: 420px; }
.case .media.video { height: 621px; }        /* Figma: 1104 × 621 */
.case .media.video.short { height: 570px; }  /* Figma: 1104 × 570 */

/* ==========================================================
   ABOUT
   ========================================================== */
.intro { display: flex; gap: 80px; align-items: flex-start; }
.intro .text { flex: 1; display: flex; flex-direction: column; gap: 24px; }
.intro .media { width: 380px; height: 460px; flex: none; border-radius: 20px; }
.row-head { display: flex; justify-content: space-between; align-items: flex-end; }
.card-scroller { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.fact { flex: 0 0 340px; height: 480px; scroll-snap-align: start; background: var(--card); border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.fact b { font-size: 22px; font-weight: 600; }
.fact span { font-size: 16px; line-height: 1.4; }
.fact .media { flex: 1; margin-top: 16px; background: transparent; }
.fact .media.empty { border: none; }

.list-block { display: flex; flex-direction: column; gap: 40px; }
.group { display: flex; align-items: flex-start; }
.group > .label { width: 200px; flex: none; font-size: 22px; color: var(--accent); padding-top: 22px; }
.group > .rows { flex: 1; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.row .name { font-size: 22px; }
.row .what { font-size: 18px; color: var(--accent); text-align: right; }
a.row:hover .name { text-decoration: underline; text-underline-offset: 4px; }

.writing a.row { position: relative; padding: 26px 0; }
.writing a.row .name { font-size: 22px; flex: 1; }
.writing a.row .what { font-size: 15px; white-space: nowrap; }
.writing a.row .arrow { color: var(--accent); opacity: 0; transition: opacity .2s; }
.writing a.row:hover .arrow { opacity: 1; }
.writing a.row .preview {
  position: absolute; left: 380px; top: -30px; width: 260px; height: 170px; z-index: 5;
  border-radius: 14px; background: var(--white); box-shadow: 0 12px 28px rgba(26, 38, 51, .18);
  transform: rotate(-4deg) translateY(8px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.writing a.row:hover .preview { opacity: 1; transform: rotate(-4deg) translateY(0); }
.writing a.row .preview.media.empty { background: var(--white); border: none; min-height: 0; }

/* ==========================================================
   RECRUITER MODE
   ========================================================== */
.project-row .name { font-family: var(--font-head); font-weight: 500; font-size: 26px; }
.project-row p { font-size: 18px; line-height: 1.5; margin-top: 6px; }
.project-row .side { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.project-row .side small { font-size: 15px; color: var(--accent); }
.project-row .side .hand { font-size: 22px; color: var(--accent); }

/* ==========================================================
   FUN STUFF
   ========================================================== */
.fun-card { display: flex; gap: 56px; align-items: center; padding: 48px; border-radius: 24px; background: var(--card); }
.fun-card.outline { background: rgba(255, 255, 255, .5); border: 1.5px solid var(--accent); }
.fun-card .media { width: 420px; height: 300px; flex: none; background: var(--cream); }
.fun-card .info { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.fun-card .btns { display: flex; gap: 16px; padding-top: 8px; }

.colorer { display: flex; flex-direction: column; align-items: center; gap: 20px; flex: none; }
.colorer svg .region { cursor: pointer; transition: fill .2s; }
.colorer svg .region:hover { filter: brightness(.95); }
.swatches { display: flex; gap: 12px; }
.swatches button { width: 32px; height: 32px; border-radius: 999px; border: 1.5px solid var(--navy); transition: transform .15s; }
.swatches button:hover { transform: scale(1.1); }
.swatches button.picked { outline: 2px solid var(--navy); outline-offset: 3px; }
.colorer .controls { display: flex; gap: 24px; align-items: center; font-family: var(--font-hand); font-size: 20px; color: var(--accent); }
.colorer .controls .dot { display: inline-block; width: 16px; height: 16px; border-radius: 999px; border: 1px solid var(--navy); vertical-align: -2px; margin-left: 6px; }
.colorer .send { display: flex; gap: 12px; }
.colorer .send input { width: 220px; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--accent); font: inherit; font-size: 15px; color: var(--navy); background: var(--white); }
.colorer .send input::placeholder { color: var(--accent); }
.colorer .thanks { font-family: var(--font-hand); font-size: 22px; color: var(--accent); min-height: 26px; }

/* Hide missing images until the file is added */
.cup.no-img img, .order-card img.gif.missing { visibility: hidden; }
.menu-row .pcard .face .wordmark { font-size: 80px; white-space: nowrap; }

/* Sidebar always fits the window: spacing shrinks on shorter screens */
.sidebar {
  top: var(--top-gap);
  max-height: calc(100vh - var(--top-gap) - 24px);
  overflow-y: auto; scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar .first   { font-size: clamp(48px, 6.5vh, 64px); }
.sidebar .last    { font-size: clamp(30px, 4vh, 40px); }
.sidebar .tagline { font-size: clamp(19px, 2.5vh, 24px); margin: clamp(16px, 4vh, 40px) 0 clamp(16px, 4.5vh, 44px); }
.sidebar .roles   { gap: clamp(8px, 2.2vh, 22px); }
.sidebar .roles a { font-size: clamp(16px, 2vh, 20px); line-height: 1.5; }
.sidebar .clock   { margin: clamp(14px, 4.5vh, 48px) 0 clamp(14px, 5vh, 56px); }
.sidebar .pill    { margin-bottom: 4px; }

/* Footer: exact Figma positions (frame 1104 × 557) */
.footer-big .left h3 { line-height: 1.0; }
.footer-big .left p { margin: 16px 0 24px; }
.footer-big .shop { left: 452px; top: 38px; width: 399px; height: 441px; object-fit: contain; }
.footer-big .right { right: 35px; top: 64px; width: 132px; align-items: center; gap: 18px; }
.footer-big .icons { flex-direction: column; gap: 14px; }
.footer-big .bottom { bottom: 40px; font-size: 14px; line-height: 18px; }

/* Arrows: small line icons instead of font arrows */
.arr { display: inline-block; width: 0.95em; height: 0.95em; vertical-align: -0.12em; margin-left: 0.3em; }
.arr.lead { margin: 0 0.15em 0 0; }
.arr path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
