@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* Theme tokens and global defaults */
:root {
  --ink: #171717;
  --yellow: #ffdf55;
  --terracotta: #e2794b;
  --ochre: #e8c56b;
  --grid: #e9e9e9;
  --line: 2px solid var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 35px;
}

body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.6 'DM Sans',Arial,sans-serif;
  background-color: #fff;
  background-image: linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px);
  background-size: 28px 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

/* Project headings receive focus for accessible navigation, not interaction. */
#project-title:focus {
  outline: none;
}

a:focus-visible, button:focus-visible {
  outline: 3px solid #74301f;
  outline-offset: 7px;
}

h1, h2, h3 {
  font-family: 'Space Grotesk',Arial,sans-serif;
  line-height: 1.1;
  letter-spacing: -.045em;
  margin: 0;
}

p {
  margin: 0 0 18px;
}

header, main, footer {
  max-width: 1240px;
  margin: auto;
  padding-left: 44px;
  padding-right: 44px;
}

/* Header and navigation */
.header {
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font: 700 36px 'Space Grotesk',sans-serif;
  letter-spacing: -3px;
}

.brand-dot {
  color: #74301f;
}

nav {
  display: flex;
  gap: 36px;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
}

.resume {
  border: var(--line);
  padding: 10px 18px;
  box-shadow: 3px 3px 0 var(--ink);
  background: white;
}

.resume span {
  margin-left: 16px;
}

/* Introduction and highlighted headline */
.intro {
  padding: 70px 0 78px;
}

.eyebrow {
  font: 500 12px/1.5 'DM Sans',Arial,sans-serif;
  letter-spacing: .12em;
}

.intro > .eyebrow {
  margin-bottom: 28px;
}

.eyebrow > span {
  margin: 0 12px;
  color: #777;
}

h1 {
  font-size: clamp(48px,6.6vw,82px);
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -.06em;
}

.highlight {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}

.highlight:after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: -6px;
  height: 29%;
  background: var(--yellow);
  z-index: -1;
}

.intro-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 32px;
  gap: 25px;
}

.intro-bottom p {
  font-size: 18px;
  margin: 0;
  line-height: 1.65;
}

.work-link {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  border-bottom: 2px solid;
  padding-bottom: 6px;
}

.work-link span {
  margin-left: 24px;
}

/* Work sections and shared card styles */
.section {
  margin-bottom: 86px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

h2 {
  font-size: 29px;
  font-weight: 600;
}

.count {
  font: 400 12px 'DM Sans',sans-serif;
  letter-spacing: 0;
  margin-left: 16px;
  color: #555;
  vertical-align: middle;
}

.featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.card {
  display: block;
  border: var(--line);
  background: #fff;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .18s,box-shadow .18s;
}

.card:hover {
  transform: translate(-3px,-3px);
  box-shadow: 9px 9px 0 var(--ink);
}

.feature {
  padding: 28px 28px 0;
  overflow: hidden;
}

.india-card {
  background: var(--terracotta);
}

.monkey-card {
  background: var(--ochre);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.tag {
  display: inline-block;
  border: 1.5px solid var(--ink);
  background: #fff;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .055em;
}

.index {
  font: 500 14px 'Space Grotesk',sans-serif;
}

.feature h3 {
  font-size: 35px;
  margin-bottom: 15px;
}

.feature > p {
  line-height: 1.55;
  font-size: 16px;
  margin-bottom: 28px;
}

.card-art {
  height: 224px;
  margin-bottom: 20px;
}

.timeline-preview {
  padding: 17px 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff9e4;
  border: var(--line);
  transform: none;
  margin-left: 5px;
  margin-right: 5px;
  overflow: hidden;
}

.timeline-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.decision-preview {
  background: rgba(255,255,255,.65);
  border: var(--line);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mini-label {
  font-size: 10px;
  letter-spacing: .065em;
  font-weight: 700;
}

.decision-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.decision-line > span:first-child {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.decision-line strong {
  background: white;
  padding: 5px 8px;
  border: 1.5px solid;
  font-size: 14px;
}

.system-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}

.system-line span {
  border-bottom: 1px solid;
  padding-bottom: 3px;
}

.system-line i {
  font-style: normal;
}

.proof {
  font-size: 12px;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1.5px solid;
  padding: 17px 0;
  font-size: 14px;
  font-weight: 500;
}

.open-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  background: #fff;
  border: 1.5px solid var(--ink);
  font: 400 25px/1 Arial;
}

/* Vector arrows avoid mobile browsers substituting colourful emoji glyphs. */
.open-icon img {
  display: block;
  width: 18px;
  height: 18px;
}

/* Keep inline arrows proportional to text without relying on emoji fonts. */
.link-arrow {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -1px;
  flex-shrink: 0;
}

/* Engineering project cards */
.engineering-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 28px;
}

.small {
  padding: 25px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.small h3 {
  font-size: 28px;
  margin: 28px 0 15px;
  line-height: 1.12;
}

.small p {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.small .card-bottom {
  margin-top: auto;
  width: 100%;
}

.lilac {
  background: #d8c6ff;
}

.nTerracotta {
  background: #e6b19a;

}

/* Exploration cards */
.exploration-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.sketch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px;
  gap: 20px;
  box-shadow: 4px 4px 0;
}

/* Colour identifies each sketchbook concept without changing its layout. */
.sketch[href="#project/hunter"] {
  background: #d9c7ed;
}

.sketch[href="#project/mesh"] {
  background: #bfe0d3;
}

.sketch h3 {
  font-size: 26px;
  margin-top: 12px;
}

.sketch .eyebrow {
  display: inline-block;
  padding: 3px 7px;
  border: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 10px;
}

/* About and contact */
.about {
  border-top: 2px solid;
  padding-top: 60px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 70px;
  margin-top: 105px;
  margin-bottom: 80px;
}

.about h2 {
  font-size: 36px;
  line-height: 1.2;
  margin-top: 20px;
}

.about p {
  font-size: 16px;
}

/* Keep the yellow marker effect on each line when the About heading wraps. */
.about h2 .highlight {
  white-space: normal;
  background: linear-gradient(transparent 65%, var(--yellow) 65%, var(--yellow) 94%, transparent 94%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.about h2 .highlight:after {
  content: none;
}

.about-summary {
  margin-top: 26px;
}

.about-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 25px;
  margin-top: 26px;
}

.about-actions .contact-button {
  margin-top: 0;
}

.about-actions .linkedin {
  margin-left: 0;
}

.about-story p {
  font-size: 18px;
  line-height: 1.75;
}

.about-story p:last-child {
  margin-bottom: 0;
}

.contact-button {
  display: inline-flex;
  background: var(--yellow);
  border: var(--line);
  box-shadow: 4px 4px 0;
  padding: 12px 20px;
  gap: 55px;
  font-weight: 600;
  margin-top: 8px;
}

.linkedin {
  margin-left: 25px;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Footer */
footer {
  border-top: 1px solid #aaa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 25px;
  padding-bottom: 30px;
  font-size: 11px;
  letter-spacing: .03em;
  gap: 20px;
}

footer > a {
  font-size: 12px;
}

/* Accessibility and hidden views */
.skip {
  position: fixed;
  top: -70px;
  left: 20px;
  background: white;
  padding: 10px;
  z-index: 10;
}

.skip:focus {
  top: 10px;
}

[hidden] {
  display: none!important;
}

/* Project detail view */
.back {
  display: inline-block;
  border: var(--line);
  background: white;
  padding: 9px 17px;
  box-shadow: 3px 3px 0;
  font-size: 14px;
  margin: 30px 0 42px;
}

.project-head {
  padding: 40px;
  border: var(--line);
  box-shadow: 6px 6px 0;
  background: var(--yellow);
  margin-bottom: 56px;
}

.project-head h1 {
  font-size: clamp(38px,6vw,66px);
  margin: 24px 0;
}

.project-head .lead {
  font-size: 21px;
  max-width: 790px;
  line-height: 1.5;
}

.project-meta {
  display: flex;
  gap: 40px;
  margin-top: 32px;
  flex-wrap: wrap;
  font-size: 14px;
}

.project-meta b {
  display: block;
  font-size: 11px;
  letter-spacing: .08em;
  margin-bottom: 5px;
}

.story {
  max-width: 810px;
  margin: 0 auto 70px;
}

.story section {
  margin-bottom: 40px;
  background: rgba(255,255,255,.9);
}

.story h2 {
  font-size: 28px;
  margin-bottom: 17px;
}

.story p, .story li {
  font-size: 17px;
  line-height: 1.8;
}

.story ul {
  padding-left: 22px;
}

.story li {
  margin-bottom: 10px;
}

/* Make inline reference links distinguishable from the surrounding copy. */
.story p a,
.story li a {
  color: #74301f;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

.story p a:hover,
.story li a:hover {
  color: var(--ink);
  background-color: var(--yellow);
}

.story-image {
  width: 100%;
  height: auto;
  border: var(--line);
  margin: 0 0 36px;
}

.callout {
  border-left: 5px solid;
  padding: 20px 25px;
  background: #fff2a9!important;
}

.project-actions {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.project-actions a {
  border: var(--line);
  padding: 12px 20px;
  background: white;
  box-shadow: 4px 4px 0;
  font-weight: 600;
  font-size: 14px;
}

.project-actions a:first-child {
  background: var(--yellow);
}

/* Wide-screen spacing */
@media (min-width: 1400px) {
  .intro {
    padding-top: 86px;
  }

}

/* Tablet layout */
@media (max-width: 950px) {
  header, main, footer {
    padding-left: 28px;
    padding-right: 28px;
  }

  .feature {
    padding: 23px 20px 0;
  }

  .feature h3 {
    font-size: 29px;
  }

  .decision-preview {
    padding: 22px 12px;
  }

  .decision-line {
    flex-wrap: wrap;
    font-size: 14px;
  }

  .engineering-grid {
    gap: 18px;
  }

  .small {
    padding: 20px 18px 0;
  }

  .small h3 {
    font-size: 24px;
  }

  .small .tag {
    font-size: 10px;
  }

  .about {
    gap: 35px;
  }

  .intro-bottom p {
    font-size: 16px;
  }

  .card-bottom {
    font-size: 13px;
  }

  .sketch {
    padding: 24px;
  }

  .sketch h3 {
    font-size: 23px;
  }

}

/* Mobile layout */
@media (max-width: 680px) {
  header, main, footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .header {
    height: 90px;
  }

  nav {
    gap: 18px;
    font-size: 13px;
  }

  .resume {
    padding: 8px 10px;
  }

  .resume span {
    margin-left: 5px;
  }

  .intro {
    padding: 42px 0 56px;
  }

  .intro > .eyebrow {
    font-size: 10px;
    letter-spacing: .08em;
  }

  .intro .eyebrow > span {
    margin: 0 6px;
  }

  h1 {
    font-size: clamp(36px,9vw,59px);
  }

  .intro-bottom {
    display: block;
    margin-top: 25px;
  }

  .intro-bottom p {
    font-size: 16px;
  }

  .intro-bottom br {
    display: none;
  }

  .work-link {
    display: inline-block;
    margin-top: 25px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  h2 {
    font-size: 26px;
  }

  .featured, .engineering-grid, .exploration-grid, .about {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .feature {
    padding: 25px 23px 0;
  }

  .feature h3 {
    font-size: 33px;
  }

  .feature > p {
    font-size: 16px;
  }

  .card-art {
    height: 215px;
  }

  .card-bottom {
    font-size: 14px;
  }

  .small h3 {
    font-size: 28px;
  }

  .small p {
    font-size: 16px;
  }

  .small .tag {
    font-size: 11px;
  }

  .small {
    padding: 25px 23px 0;
  }

  .small .card-bottom {
    padding: 15px 0;
  }

  .section {
    margin-bottom: 62px;
  }

  .about {
    margin-top: 76px;
    padding-top: 40px;
    gap: 20px;
  }

  .about h2 {
    font-size: 32px;
  }

  .about .eyebrow {
    font-size: 12px;
  }

  .sketch h3 {
    font-size: 23px;
  }

  footer {
    flex-wrap: wrap;
    font-size: 10px;
  }

  footer span:nth-child(2) {
    width: 100%;
    order: 3;
  }

  footer a {
    margin-left: auto;
  }

  .project-head {
    padding: 27px 23px;
  }

  .project-head h1 {
    font-size: 39px;
  }

  .project-head .lead {
    font-size: 18px;
  }

  .project-meta {
    gap: 22px;
  }

  .story p, .story li {
    font-size: 16px;
  }

  .project-actions {
    flex-direction: column;
  }

  .project-actions a {
    text-align: center;
  }

  .back {
    margin: 20px 0 32px;
  }

  .desktop {
    display: none;
  }

}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card {
    transition: none;
  }

}

/* Case-study deck previews */
.deck-preview {
  height: auto;
  aspect-ratio: 16/9;
  padding: 0;
  border: var(--line);
  background: white;
  overflow: hidden;
  transform: none;
  margin-left: 0;
  margin-right: 0;
}

.deck-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Later refinements stay here to preserve cascade precedence. */
.intro {
  position: relative;
  isolation: isolate;
}

.explorations {
  position: relative;
  isolation: isolate;
}

.sketch p {
  font-size: 15px;
  line-height: 1.6;
  margin: 16px 0 0;
  max-width: 350px;
}

.sketch {
  align-items: flex-start;
}

.sketch > .open-icon {
  align-self: flex-end;
}

.small p {
  font-size: 16px;
}

.small h3 {
  min-height: 2.3em;
}

/* Project videos share the gallery border and shadow, scaling to the story width. */
.project-video video {
  display: block;
  width: 100%;
  height: auto;
  border: var(--line);
  background: #171717;
  box-shadow: 4px 4px 0 var(--ink);
}

/* Original concept notes and diagrams within the longer Sketchbook stories. */
.comparison-scroll {
  overflow-x: auto;
  margin: 24px 0;
}

.concept-comparison {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 16px;
  line-height: 1.65;
}

.concept-comparison th,
.concept-comparison td {
  padding: 16px;
  border: var(--line);
  text-align: left;
  vertical-align: top;
}

.concept-comparison thead {
  background: var(--yellow);
}

.concept-comparison tbody th {
  width: 32%;
}

.concept-figure {
  margin: 28px 0 36px;
}

.concept-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: white;
  border: var(--line);
}

.concept-figure figcaption {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

/* Frame only the network at the top of the original note, excluding its written steps. */
.tarot-web-crop {
  aspect-ratio: 1537 / 365;
  overflow: hidden;
  border: var(--line);
  background: white;
}

.tarot-web-crop img {
  border: 0;
}

.story-image[src="assets/tarot-hunter-flier.webp"] {
  display: block;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.story ol {
  padding-left: 26px;
}

.mechanical-gallery figure {
  margin: 30px 0 38px;
}

.mechanical-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--line);
  background: white;
  box-shadow: 4px 4px 0 var(--ink);
}

.mechanical-gallery figcaption {
  padding: 18px 2px;
  font-size: 15px;
  line-height: 1.5;
}

.mechanical-gallery figcaption span {
  display: block;
  color: #555;
  font-size: 13px;
  margin-top: 5px;
}

.card-art {
  flex-shrink: 0;
}

.feature {
  display: flex;
  flex-direction: column;
}

.feature > .card-bottom {
  margin-top: auto;
}

.feature > .deck-preview {
  margin-top: auto;
  margin-bottom: 20px;
}

@media (max-width: 950px) {
}

@media (max-width: 680px) {
  .small h3 {
    min-height: 0;
  }

  .sketch p {
    font-size: 16px;
  }

  .feature .deck-preview {
    height: auto;
    aspect-ratio: 16/9;
  }

}

/* A single vertical rail keeps overlapping education and work dates readable. */
.experience-timeline { list-style: none; margin: 44px 0 0; padding: 0; position: relative; }
.experience-timeline::before { content: ""; position: absolute; top: 20px; bottom: 30px; left: 189px; width: 3px; background: var(--ink); }
/* A small end marker is centred on the bottom of the timeline rail. */
.experience-timeline::after { content: ""; position: absolute; bottom: 24px; left: 190.5px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); transform: translateX(-50%); }
.timeline-entry { position: relative; display: grid; grid-template-columns: 160px 60px minmax(0,1fr); padding-bottom: 36px; }
.timeline-entry:last-child { padding-bottom: 0; }
.timeline-date { padding-top: 12px; font-family: 'Space Grotesk',sans-serif; font-weight: 600; font-size: 16px; }
.timeline-date span { display: inline-block; margin: 0 6px; font-weight: 400; }
.timeline-date time { display: block; }
.timeline-node { position: relative; z-index: 1; width: 42px; height: 42px; margin: 10px auto 0; display: grid; place-items: center; background: var(--yellow); border: var(--line); font: 700 16px 'Space Grotesk',sans-serif; box-shadow: 3px 3px 0 var(--ink); }
.timeline-card { margin-left: 24px; padding: 28px 32px; border: var(--line); background: #fff; box-shadow: 6px 6px 0 var(--ink); transition: transform .25s ease, box-shadow .25s ease; }
/* Distinct pastel colours keep every milestone visible against the grid. */
.timeline-entry:nth-child(1) .timeline-card { background: #c4dfef; }
.timeline-entry:nth-child(2) .timeline-card { background: #cce3bd; }
.timeline-entry:nth-child(3) .timeline-card { background: #f2cd78; }
.timeline-entry:nth-child(4) .timeline-card { background: #d9c7ed; }
.timeline-entry:nth-child(5) .timeline-card { background: #f0bfc8; }
.timeline-card h3 { font-size: clamp(24px,3vw,34px); margin: 14px 0 8px; }
.timeline-card .timeline-org { font-weight: 700; font-size: 18px; margin-bottom: 16px; }
.timeline-card p:last-child { margin-bottom: 0; max-width: 65ch; }
/* Content stays visible without JS. Only observed entries receive motion. */
.timeline-entry.is-revealed .timeline-card { animation: timeline-arrive 1.5s cubic-bezier(.22,.75,.25,1) backwards; }
.timeline-entry.is-revealed .timeline-node { animation: timeline-stamp 1.2s cubic-bezier(.34,1.56,.64,1) backwards; }
@keyframes timeline-arrive { from { opacity: 0; transform: translateY(72px) rotate(4deg); box-shadow: 0 0 0 var(--ink); } to { opacity: 1; transform: translateY(0) rotate(0); box-shadow: 6px 6px 0 var(--ink); } }
@keyframes timeline-stamp { from { transform: scale(.35) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
@media (hover: hover) { .timeline-card:hover { transform: translate(-3px,-3px); box-shadow: 9px 9px 0 var(--ink); } }
@media (max-width: 680px) {
  nav { gap: 14px; font-size: 13px; }
  .experience-timeline::before { left: 19px; }
  .experience-timeline::after { left: 20.5px; }
  .timeline-entry { grid-template-columns: 42px minmax(0,1fr); column-gap: 16px; padding-bottom: 30px; }
  .timeline-date { grid-column: 2; padding: 0 0 12px; font-size: 14px; }
  .timeline-date time { display: inline; }
  .timeline-node { grid-column: 1; grid-row: 1 / 3; width: 38px; height: 38px; margin-top: 0; }
  .timeline-card { grid-column: 2; margin-left: 0; padding: 20px; box-shadow: 4px 4px 0 var(--ink); }
  .timeline-card .timeline-org { font-size: 16px; }
  .experience .section-heading { flex-wrap: wrap; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .timeline-entry.is-revealed .timeline-card, .timeline-entry.is-revealed .timeline-node { animation: none; }
  .timeline-card { transition: none; }
}

/* Let navigation wrap below the initials on narrow phones. */
@media (max-width: 400px) {
  .header { height: auto; min-height: 110px; flex-wrap: wrap; gap: 10px; padding-top: 14px; padding-bottom: 14px; }
  .header nav { width: 100%; justify-content: space-between; gap: 8px; }
}
