/* Profile and background precede the project timeline and three case studies. */
:root {
  --folio-width: 1440px;
  --folio-text: #172633;
  --folio-secondary: #4e6070;
  --folio-rule: #dce3e9;
  --folio-blue: #185da6;
}

html { scroll-padding-top: calc(var(--header) + 14px); }
.overview, #main { max-width: var(--folio-width); }
#projects.projects-opening {
  padding: clamp(30px, 3.6vw, 54px) 0 0;
  border-top: 1px solid var(--folio-rule);
}
#projects .projects-opening-inner,
#project-timeline .timeline-dock {
  width: 100%;
  max-width: var(--folio-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
#projects .projects-opening-inner {
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-bottom: 20px;
}
#projects h2 {
  color: var(--folio-text);
  font-size: clamp(32px, 3.7vw, 54px);
  line-height: 1.16;
  letter-spacing: -.055em;
}
#projects .projects-years {
  color: var(--folio-secondary);
  font-size: 13px;
  letter-spacing: .04em;
}
.timeline-instruction {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--folio-secondary);
}
#projects > .timeline-instruction {
  max-width: var(--folio-width);
  margin-inline: auto;
  padding: 0 var(--gutter) 16px;
}
#projects .projects-opening-inner:has(+ .timeline-instruction) { padding-bottom: 9px; }
#projects .projects-opening-inner > .timeline-instruction { flex-basis: 100%; }
.timeline-instruction .touch-tip { display: none; }
.timeline-overview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  max-width: var(--folio-width);
  margin-inline: auto;
  padding: 0 var(--gutter) 18px;
}
.timeline-overview-meta .timeline-instruction { margin: 0; color: #75818c; font-size: 12px; }
.timeline-key {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #647480;
  font-size: 11px;
  line-height: 1.6;
}
.timeline-key li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.timeline-key li::before {
  content: '';
  display: block;
  width: 20px;
  height: 7px;
  border-inline: 1px solid #b5c2ce;
  background: linear-gradient(#b5c2ce, #b5c2ce) center / 100% 2px no-repeat;
}
.timeline-key .key-featured::before { height: 8px; border: 0; border-radius: 2px; background: #5b94d5; }
@media (hover: none), (pointer: coarse) {
  .timeline-instruction .pointer-tip { display: none; }
  .timeline-instruction .touch-tip { display: inline; }
}

/* Dates share the configured monthly axis with the year labels and grid.
   The visible line, including an ongoing arrowhead, spans exactly that range.
   Each label belongs to its line, but can extend beyond a very short period. */
#project-timeline {
  --timeline-months: 47;
  --lane-title-width: clamp(104px, 12vw, 166px);
  --row-step: 32px;
  --row-pad: 6px;
  --period-ink: #334958;
  --period-line: #b5c2ce;
  height: auto;
}
#project-timeline .timeline-dock,
#project-timeline .timeline-dock.is-pinned {
  position: relative;
  inset: auto;
  transform: none;
  z-index: auto;
  padding-top: 0;
  padding-bottom: 0;
  background: white;
  border: 0;
}
#project-timeline .timeline-scroll { overflow: visible; }
#project-timeline .timeline-grid {
  min-width: 0;
  padding: 0;
  border-block: 1px solid var(--folio-rule);
}
#project-timeline .time-axis,
#project-timeline .timeline-lane {
  grid-template-columns: var(--lane-title-width) minmax(0, 1fr);
}
#project-timeline .years {
  font-size: 13px;
  line-height: 19px;
  font-variant-numeric: tabular-nums;
}
#project-timeline .years b {
  width: calc(12 / var(--timeline-months) * 100%);
  padding: 9px 8px 4px;
  color: #354b5c;
  font-weight: 650;
  border-color: var(--folio-rule);
}
#project-timeline .month-axis { margin: 0 0 7px; }
#project-timeline .months {
  grid-template-columns: repeat(var(--timeline-months), minmax(0, 1fr));
  line-height: 13px;
  font-variant-numeric: tabular-nums;
  color: #697683;
}
#project-timeline .timeline-lane {
  height: calc(2 * var(--row-pad) + 3 * var(--row-step));
  overflow: visible;
  box-shadow: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--folio-rule);
  border-radius: 0;
  background: transparent;
  isolation: auto;
}
#project-timeline .timeline-lane:has(.track.double) {
  height: calc(2 * var(--row-pad) + 2 * var(--row-step));
}
#project-timeline .timeline-lane > strong {
  align-self: start;
  padding: calc(var(--row-pad) + 1px) 12px 0 0;
  font-size: 13px;
  line-height: 19px;
  font-weight: 650;
  color: #334857;
}
#project-timeline .timeline-lane > strong::before {
  height: 11px;
  width: 3px;
}
#project-timeline .track {
  height: 100%;
  border-left: 0;
  background:
    repeating-linear-gradient(90deg, #dce3ea 0 1px, transparent 1px calc(100% * 12 / var(--timeline-months))),
    repeating-linear-gradient(90deg, #f0f2f5 0 1px, transparent 1px calc(100% / var(--timeline-months)));
}
#project-timeline .period {
  --mark: var(--period-line);
  --label: var(--period-ink);
  position: absolute;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 7px;
  left: calc(var(--start) / var(--timeline-months) * 100%);
  top: calc(var(--row-pad) + var(--row) * var(--row-step));
  width: calc(var(--duration) / var(--timeline-months) * 100%);
  min-width: 0;
  height: 30px;
  padding: 0;
  margin: 0;
  overflow: visible;
  color: var(--label);
  background: transparent;
  border: 0;
  border-radius: 0;
  text-decoration: none;
  text-align: left;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
}
#project-timeline .period::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 23px;
  height: 5px;
  border-radius: 2px;
  background: var(--mark);
}
#project-timeline .period.ongoing::before { right: 5px; border-radius: 2px 0 0 2px; }
#project-timeline .period.ongoing::after {
  content: "";
  position: absolute;
  top: 20px;
  right: 0;
  width: 0;
  height: 0;
  border: solid transparent;
  border-width: 5.5px 0 5.5px 5px;
  border-left-color: var(--mark);
}
#project-timeline .period:not(.featured)::before {
  top: 22px;
  height: 8px;
  border-inline: 1px solid var(--mark);
  border-radius: 0;
  background: linear-gradient(var(--mark), var(--mark)) center / 100% 2px no-repeat;
}
#project-timeline .period.ongoing:not(.featured)::before { border-right: 0; right: 4px; }
#project-timeline .period.ongoing:not(.featured)::after {
  top: 22.5px;
  border-width: 3.5px 0 3.5px 4px;
}
#project-timeline .period > span,
#project-timeline .period > small {
  position: relative;
  inset: auto;
  flex: none;
  align-self: baseline;
  width: auto;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  line-height: 19px;
  white-space: nowrap;
  text-align: inherit;
}
#project-timeline .period > span { font-size: 12.5px; font-weight: 600; color: var(--label); }
#project-timeline .period > small { color: #637382; font-size: 10px; font-variant-numeric: tabular-nums; }
#project-timeline .period.end-label { justify-content: flex-end; }
#project-timeline .period.featured { --mark: #5b94d5; --label: var(--folio-blue); }
#project-timeline .period.featured > span { font-weight: 720; }
#project-timeline .period:is(:hover, :focus-visible, [aria-expanded="true"]) {
  --mark: var(--folio-blue);
  --label: var(--folio-blue);
  z-index: 2;
}
#project-timeline .period:is(:hover, :focus-visible, [aria-expanded="true"]) > span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
#project-timeline .period:focus-visible { outline: none; }
#project-timeline .period:focus-visible > span { outline: 2px solid var(--folio-blue); outline-offset: 3px; }
@media (min-width: 861px) {
  #project-timeline .period.featured::before { top: 22px; height: 8px; border-radius: 2px; }
  #project-timeline .period.ongoing::after { display: none; }
  #project-timeline .period.featured.ongoing::before {
    right: 0;
    border-radius: 2px 0 0 2px;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%);
  }
  #project-timeline .period.ongoing:not(.featured)::before {
    top: 24.5px;
    right: 0;
    height: 3px;
    border: 0;
    background: var(--mark);
    clip-path: polygon(0 0, calc(100% - 3px) 0, 100% 50%, calc(100% - 3px) 100%, 0 100%);
  }
}
#project-timeline .timeline-foot:empty { display: none; }

/* Project titles are editorial headings. Only the controls within a case act
   as buttons; the photograph, interactive demo and repository links stay live. */
#main { min-width: 0; }
.featured-projects { margin-top: clamp(32px, 4vw, 56px); }
#main.featured-projects { margin-top: clamp(32px, 4vw, 56px); }
.featured-projects.project-group {
  border: 0;
  box-shadow: none;
  background: transparent;
  margin-inline: auto;
}
.featured-section-heading {
  position: relative;
  z-index: 5;
  display: block;
  padding-bottom: 28px;
  border: 0;
}
.featured-heading-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 42px;
}
.featured-scroll-link { position: absolute; inset: 0; z-index: 1; }
.featured-scroll-link:focus-visible { outline: 2px solid #397bcc; outline-offset: 4px; border-radius: 2px; }
.featured-scroll-cue {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 1fr;
  align-content: center;
  justify-items: center;
  gap: 0;
  min-width: 0;
  width: auto;
  height: 28px;
  color: #587b96;
  pointer-events: none;
}
.featured-scroll-cue svg {
  position: static;
  display: block;
  width: 22px;
  max-width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  animation: featured-scroll-down 2.1s ease-in-out infinite;
}
.featured-section-heading:hover .featured-scroll-cue { color: #2d6f9f; }
@keyframes featured-scroll-down {
  0% { transform: translateY(-5px); opacity: 0; }
  18% { opacity: .95; }
  45% { opacity: 1; }
  90%, 100% { transform: translateY(6px); opacity: 0; }
}
#shinjuku .case-entry-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 4;
}
#shinjuku .case-entry-track::before {
  top: -1px;
  height: 1px;
  background: #dce3e9;
}
.featured-boundary-wave { position: absolute; left: calc(-1 * var(--gutter)); bottom: 0; width: calc(100% + 2 * var(--gutter)); height: 34px; overflow: visible; pointer-events: none; }
.featured-boundary-wave path { fill: none; stroke-width: 1.15; vector-effect: non-scaling-stroke; opacity: 0; animation: featured-wave-rise 2.1s ease-out infinite; }
.featured-boundary-wave path:nth-of-type(1) { --wave-distance: -28px; --wave-opacity: .65; }
.featured-boundary-wave path:nth-of-type(2) { --wave-distance: -18px; --wave-opacity: .43; }
.featured-boundary-wave path:nth-of-type(3) { --wave-distance: -9px; --wave-opacity: .26; }
@keyframes featured-wave-rise {
  0% { transform: translateY(0); opacity: 0; }
  18%, 45% { opacity: var(--wave-opacity); }
  90%, 100% { transform: translateY(var(--wave-distance)); opacity: 0; }
}
.featured-section-heading h2 {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -.045em;
  color: var(--folio-text);
}
.featured-section-heading p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  color: var(--folio-secondary);
}
.featured-projects .project.featured-case {
  min-width: 0;
  display: block;
  padding: 0;
  border: 0;
  scroll-margin-top: -14px;
}
.featured-projects .project.featured-case + .project.featured-case { border-top: 1px solid #aebdc8; }
.featured-case > .project-disclosure > .project-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  align-items: center;
  gap: 20px clamp(24px, 5vw, 76px);
  padding: clamp(34px, 4vw, 60px) 0 30px;
  border-radius: 0;
  cursor: auto;
}
.featured-case .project-summary .project-expand-icon { display: none; }
.featured-case .project-summary .tech-badge { cursor: auto; }
.featured-case .case-index {
  color: var(--folio-blue);
  font-size: 11px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}
.featured-case .project-summary-identity > .case-index { display: block; margin: 0 0 8px; }
.featured-case .eyebrow > .case-index { padding-right: 10px; border-right: 1px solid var(--folio-rule); }
.featured-case > .project-disclosure > .project-body {
  padding-bottom: clamp(48px, 6vw, 88px);
}
.featured-case:last-child > .project-disclosure > .project-body { padding-bottom: 0; }
.featured-case .project-body > .project-copy > .summary {
  font-size: clamp(14px, 1.1vw, 16px);
  color: #3d4c58;
}
.header .reading-track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 861px) {
  #project-timeline .period > small {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  #project-timeline #group-collaboration {
    --pixel-mat-row: 1;
    height: calc(2 * var(--row-pad) + 2 * var(--row-step));
  }
}

/* A narrow viewport gets a complete dated index in normal reading order.
   Names, dates, and categories stay visible without a horizontal gesture. */
@media (max-width: 860px) {
  #project-timeline .time-axis { display: none; }
  #project-timeline .timeline-lane,
  #project-timeline .timeline-lane:has(.track.double) {
    height: auto;
    grid-template-columns: clamp(82px, 16vw, 126px) minmax(0, 1fr);
  }
  #project-timeline .timeline-lane:first-of-type,
  #project-timeline .month-axis + .timeline-lane { border-top: 0; }
  #project-timeline .timeline-lane > strong { padding-top: 15px; }
  #project-timeline .timeline-lane .track {
    display: grid;
    height: auto;
    padding-block: 3px;
    background: none;
  }
  #project-timeline .period,
  #project-timeline .period.ongoing {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 42px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    align-items: center;
    justify-content: stretch;
    padding: 6px 0 6px 14px;
  }
  #project-timeline .period + .period { border-top: 1px solid #eef1f4; }
  #project-timeline .period::before,
  #project-timeline .period.ongoing::before {
    inset: auto;
    top: 50%;
    left: 1px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--mark);
    transform: translateY(-50%);
  }
  #project-timeline .period.ongoing::after { display: none; }
  #project-timeline .period:not(.featured)::before {
    inset: auto;
    top: 50%;
    left: 1px;
    width: 6px;
    height: 6px;
    border: 1px solid var(--mark);
    border-radius: 50%;
    background: #fff;
  }
  #project-timeline .period.ongoing > small::after { content: " →"; content: " →" / ""; }
  #project-timeline .period > span,
  #project-timeline .period > small { align-self: center; line-height: 1.45; }
  #project-timeline .period > span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 13px;
  }
  #project-timeline .period > small { font-size: 11px; text-align: right; }
}
@media (max-width: 760px) {
  .featured-section-heading { padding-bottom: 24px; }
  .featured-heading-content { gap: 8px; min-height: 36px; }
  .featured-scroll-cue { height: 24px; }
  .featured-scroll-cue svg { width: 14px; stroke-width: 2; }
  .featured-section-heading h2 { white-space: nowrap; }
  #projects .projects-opening-inner { padding-bottom: 16px; }
  #projects .projects-opening-inner:has(+ .timeline-instruction) { padding-bottom: 8px; }
  #projects .projects-years, .timeline-instruction { font-size: 12px; }
  .featured-case > .project-disclosure > .project-summary { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 32px 0 22px; }
  .featured-case .project-highlights { grid-column: 1; grid-row: auto; }
  .featured-case .project-highlights > span { font-size: 13px; }
  .featured-case .project-highlights > span:first-child { font-size: 14px; }
}
@media (max-width: 540px) {
  .timeline-overview-meta { gap: 9px; padding-bottom: 14px; }
  .timeline-key { gap: 15px; font-size: 10px; }
  #project-timeline .timeline-lane,
  #project-timeline .timeline-lane:has(.track.double) {
    display: block;
    padding: 10px 0 6px;
  }
  #project-timeline .timeline-lane > strong { padding: 0 0 3px; font-size: 11px; }
  #project-timeline .timeline-lane > strong::before { height: 9px; }
  #project-timeline .timeline-lane .track { padding-block: 0; }
  #project-timeline .period,
  #project-timeline .period.ongoing { padding-left: 12px; }
  .header nav { gap: 12px; }
  .header.is-reading-projects { gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .featured-scroll-cue svg { animation: none; transform: none; opacity: .65; }
  .featured-boundary-wave { display: none; }
}
@media print {
  .featured-scroll-cue, .featured-boundary-wave, #shinjuku .case-entry-track::before { display: none; }
  .featured-projects, #main.featured-projects { margin-top: 20px; }
  .featured-case > .project-disclosure > .project-summary { padding: 20px 0 12px; }
  .featured-case > .project-disclosure > .project-body { padding-bottom: 22px; }
}
