:root {
  color-scheme: light;
  --background: #fff;
  --surface: #fff;
  --foreground: #0f0f0f;
  --muted: #5e5e5e;
  --faint: #8c8c8c;
  --subtle: #f6f6f6;
  --line: #ebebeb;
  --inverse: #fff;
  --shadow: #00000008;
  --shadow-strong: #00000012;
  --backdrop: #ededed;
  --ascii: 120, 120, 120;
  /* One accent, taken from the umbrella artwork. Small marks only. */
  --accent: #d9461c;
  /* Frosted glass for cards: translucent surface, background blur, a light top edge. */
  --glass: rgba(24, 24, 24, .035);
  --glass-inner: rgba(255, 255, 255, .6);
  --page-width: 64rem;
  --narrow-width: 36rem;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-optical-sizing: auto;
  color: var(--foreground);
  background: var(--background);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #0f0f0f;
  --surface: #151515;
  --foreground: #f2f2f2;
  --muted: #ababab;
  --faint: #7a7a7a;
  --subtle: #1b1b1b;
  --line: #262626;
  --inverse: #0f0f0f;
  --shadow: #0000004d;
  --shadow-strong: #00000080;
  --backdrop: #1c1c1c;
  --ascii: 150, 150, 150;
  --accent: #f0612f;
  --glass: rgba(255, 255, 255, .045);
  --glass-inner: rgba(255, 255, 255, .05);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5.5rem; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { margin: 0; position: relative; overflow-x: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, ul, figure { margin: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: .3rem; }

.icon { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { width: 1rem; height: 1rem; fill: currentColor; }
.accent { color: var(--accent); }
.dot { width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }

.shell { position: relative; width: min(var(--page-width), 100% - 2rem); margin-inline: auto; }
.narrow { width: min(var(--narrow-width), 100%); margin-inline: auto; }
.center { display: flex; justify-content: center; }

.skip-link {
  position: fixed; z-index: 10; top: .75rem; left: .75rem;
  padding: .75rem 1rem; border-radius: .5rem;
  background: var(--foreground); color: var(--inverse);
  clip-path: inset(50%); transform: translateY(-200%);
}
.skip-link:focus { clip-path: none; transform: none; }

/* Glass: frosted, translucent surfaces with no borders or outlines */

.project, .panel, .contact, .polaroids a, .nav-pill, .pill, .hero .eyebrow {
  border: 0 !important;
  background: var(--glass) !important;
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.nav-pill { background: color-mix(in srgb, var(--surface) 62%, transparent) !important; }

.row, .contact-card, .chips li, .socials a, .mark, .button-secondary, .nav-pill [aria-current] {
  border: 0 !important;
  background: var(--glass-inner) !important;
  box-shadow: none !important;
}

.polaroids a { background: var(--glass-inner) !important; }
.polaroids a:is(:hover, :focus-visible) { box-shadow: 0 .9rem 2rem var(--shadow-strong); }
.socials a:hover, .button-secondary:hover { background: var(--glass) !important; }

/* Navigation */

.header {
  position: fixed; z-index: 5; top: 1rem; left: 50%;
  width: max-content; max-width: calc(100% - 1rem);
  transform: translateX(-50%);
}

.nav-pill {
  display: flex; align-items: center; gap: .1rem;
  padding: .25rem;
  border: 0;
  border-radius: 2rem;
  background: var(--surface);
  box-shadow: 0 .2rem .8rem var(--shadow-strong);
}

.nav-pill a, .theme-toggle {
  display: inline-flex; min-height: 2.15rem; align-items: center; justify-content: center;
  border: 0; border-radius: 2rem;
  background: none; color: var(--muted);
  font-family: inherit; font-size: .84rem; font-weight: 500; line-height: 1;
  white-space: nowrap; text-decoration: none;
}

.nav-pill a { padding-inline: .9rem; }
.nav-pill a:hover, .theme-toggle:hover { color: var(--foreground); }
.nav-pill [aria-current] { border-color: var(--line); background: var(--subtle); color: var(--foreground); }

.theme-toggle { width: 2.15rem; padding: 0; color: var(--foreground); cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun, :root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }

/* Hero */

.hero-backdrop {
  position: absolute;
  inset: .4rem .4rem auto;
  height: min(46rem, 88svh);
  overflow: hidden;
  border-radius: 1.75rem;
  background: radial-gradient(ellipse 80% 70% at 50% 0%, var(--backdrop), var(--background) 75%);
  /* Fade out toward the bottom, and clear a quiet area behind the headline. */
  --hole: radial-gradient(ellipse 34% 30% at 31% 50%, transparent 25%, #000 100%);
  --shelter: radial-gradient(ellipse 26% 36% at 72% 52%, transparent 30%, #000 100%);
  mask-image: linear-gradient(#000 40%, transparent 98%), var(--hole), var(--shelter);
  mask-composite: intersect;
  -webkit-mask-image: linear-gradient(#000 40%, transparent 98%), var(--hole), var(--shelter);
  -webkit-mask-composite: source-in;
  pointer-events: none;
}

.ascii-field { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  min-height: min(40rem, 80svh);
  padding-block: 7.5rem 4rem;
}

.hero-copy { display: grid; justify-items: start; }
.intro-name { font-size: 1rem; font-weight: 500; }

h1, h2 { font-weight: 500; letter-spacing: -.04em; text-wrap: balance; }

h1 {
  margin-block: .7rem 1.1rem;
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  line-height: 1.02;
}

.hero-description, .section-heading p, .contact-copy p {
  max-width: 30rem;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  line-height: 1.55;
  letter-spacing: -.012em;
  text-wrap: pretty;
}

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.hero .actions { margin-top: 1.7rem; }

.hero-umbrella {
  justify-self: end;
  width: min(118%, 36rem);
  margin-block: -5rem -3rem;
  margin-right: -3rem;
}

.umbrella-canvas { display: block; width: 100%; aspect-ratio: 1; }

/* Buttons and links */

.button {
  display: inline-flex; min-height: 2.6rem; align-items: center; justify-content: center; gap: .5rem;
  padding: .55rem 1.05rem;
  border: 0; border-radius: .7rem;
  background: var(--foreground); color: var(--inverse);
  font-size: .9rem; font-weight: 500; text-decoration: none;
}

.button:hover { opacity: .86; }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--foreground); box-shadow: 0 .15rem .5rem var(--shadow); }
.button-secondary:hover { opacity: 1; background: var(--subtle); }

.text-link { color: var(--foreground); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .25em; }
.text-link:hover { text-decoration-color: var(--accent); }

/* Section headings */

.section-heading { display: grid; justify-items: center; gap: .8rem; margin-bottom: clamp(2rem, 4vw, 2.75rem); text-align: center; }
h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.08; }

.label-heading {
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 .7rem .2rem;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.work { padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem); }

/* Project cards */

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; align-items: start; }

.project {
  display: grid;
  gap: .75rem;
  padding: .9rem .9rem 1.25rem;
  border: 0;
  border-radius: 1.4rem;
  background: var(--surface);
  box-shadow: 0 .2rem .8rem var(--shadow);
}

.project-head { display: flex; align-items: center; gap: .7rem; padding: .1rem .1rem .2rem; font-size: .92rem; font-weight: 500; }

.mark {
  display: grid; width: 2rem; height: 2rem; flex: none; place-items: center;
  border: 0; border-radius: .55rem;
  background: var(--surface); color: var(--foreground);
  object-fit: cover;
}
.mark-glyph .icon, .mark-glyph .icon-fill { width: 1rem; height: 1rem; }

.pill {
  display: inline-flex; align-items: center; gap: .4rem; margin-left: auto;
  padding: .25rem .6rem; border: 0; border-radius: 2rem;
  color: var(--muted); font-size: .74rem; font-weight: 500;
}

.project-media { display: block; overflow: hidden; border-radius: .9rem; background: var(--subtle); aspect-ratio: 16 / 10; }
.project-media img { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: top; }

.project h3 { margin-top: .4rem; padding-inline: .2rem; font-size: clamp(1.15rem, 1.7vw, 1.32rem); font-weight: 500; line-height: 1.25; letter-spacing: -.025em; text-wrap: balance; }
.project h3 a { text-decoration: none; }
.project h3 a:hover { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .2em; }
.project > p { padding-inline: .2rem; color: var(--muted); font-size: .94rem; line-height: 1.55; text-wrap: pretty; }
.project > .project-meta { margin-top: .35rem; color: var(--faint); font-size: .8rem; }

/* Captain's Reach */

.project-wide {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  padding: .9rem;
}
.project-wide-copy { display: grid; gap: .75rem; padding: .5rem 1rem .5rem 0; }
.project-wide-copy h3 { margin-top: .2rem; padding-inline: .2rem; font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 500; line-height: 1.2; letter-spacing: -.03em; }
.project-wide-copy h3 a { text-decoration: none; }
.project-wide-copy > p { padding-inline: .2rem; color: var(--muted); font-size: .94rem; line-height: 1.55; }
.project-wide-copy > .project-meta { color: var(--faint); font-size: .8rem; }

.project-wide .sea { aspect-ratio: 2 / 1; }
.sea svg { width: 100%; height: 100%; }
.sea .grid-dot { fill: var(--line); }
.sea .contour path { fill: none; stroke: var(--faint); stroke-width: 1; }
.sea .contour path:nth-child(odd) { fill: var(--surface); }
.sea .route { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 4 5; }
.sea .route-faint { stroke: var(--faint); }
.sea .port { fill: var(--surface); stroke: var(--foreground); stroke-width: 1.4; }
.sea .ship { fill: var(--accent); }

/* Panels, list rows, chips */

.panel {
  padding: .55rem;
  border: 0;
  border-radius: 1.4rem;
  background: var(--subtle);
}

.rows { display: grid; gap: .45rem; padding: 0; list-style: none; }

.row {
  display: flex; align-items: center; gap: .85rem;
  padding: .7rem .8rem;
  border: 0;
  border-radius: 1rem;
  background: var(--surface);
}

.row h3 { font-size: .95rem; font-weight: 600; letter-spacing: -.015em; }
.row h3 a { text-decoration: none; }
.row h3 a:hover { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .2em; }
.row p { margin-top: .15rem; color: var(--faint); font-size: .8rem; line-height: 1.4; }

.more summary {
  display: flex; justify-content: center; align-items: center; gap: .45rem;
  min-height: 2.3rem; margin-top: .2rem;
  font-size: .82rem; font-weight: 600; list-style: none; cursor: pointer;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { width: .38rem; height: .38rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; transform: translateY(-.1rem) rotate(45deg); }
.more[open] summary { margin-bottom: .45rem; }
.more[open] summary::after { transform: translateY(.1rem) rotate(225deg); }
.more:not([open]) .when-open, .more[open] .when-closed { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; padding: .8rem; list-style: none; }
.chips li { padding: .45rem .8rem; border: 0; border-radius: 2rem; background: var(--surface); font-size: .84rem; }

/* Apps */

.apps { padding-block: clamp(4rem, 8vw, 6rem) 0; }

.polaroid-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-bottom: 1.75rem;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 3vw, 2.5rem);
  border-radius: 1.75rem;
  background: radial-gradient(ellipse 80% 90% at 50% 0%, var(--backdrop), var(--background) 80%);
}
.polaroid-stage .ascii-field {
  z-index: -1;
  mask-image: linear-gradient(#000 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(#000 30%, transparent 100%);
}

.polaroids {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 46rem;
  margin-inline: auto;
  gap: clamp(.6rem, 1.4vw, 1rem);
  padding: 0;
  list-style: none;
}

.polaroids a {
  display: grid; gap: .55rem;
  padding: .35rem .35rem .7rem;
  border: 0; border-radius: .9rem;
  background: var(--surface);
  box-shadow: 0 .3rem 1rem var(--shadow-strong);
  font-size: .8rem; font-weight: 500; text-align: center; text-decoration: none;
  transform: rotate(var(--tilt, 0deg));
}

.polaroids li:nth-child(odd) { --tilt: -2.5deg; }
.polaroids li:nth-child(even) { --tilt: 2deg; }
.polaroids li:nth-child(3n) { --tilt: -1deg; }
.polaroids img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: .6rem; background: var(--subtle); }

.polaroids a:is(:hover, :focus-visible) {
  transform: rotate(0deg) translateY(-.45rem) scale(1.03);
  box-shadow: 0 .9rem 2rem var(--shadow-strong);
}

@media (prefers-reduced-motion: no-preference) {
  .polaroids a { transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s; }
}

/* About */

.studio { padding-top: clamp(4rem, 8vw, 6rem); }
.intro-card { display: grid; gap: 1rem; padding: clamp(1.4rem, 4vw, 2rem); }
.intro-card h2 { font-size: clamp(1.4rem, 2.4vw, 1.7rem); letter-spacing: -.03em; color: var(--muted); }
.intro-card .underline { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
.intro-card p { color: var(--faint); font-size: .94rem; line-height: 1.65; }
.intro-card strong { color: var(--foreground); font-weight: 600; }

/* Bottom: the hero's ASCII field again, fading upward behind the contact card */

.bottom-backdrop {
  position: absolute;
  z-index: -1;
  inset: auto .4rem .4rem;
  height: min(40rem, 80svh);
  overflow: hidden;
  border-radius: 1.75rem;
  background: radial-gradient(ellipse 80% 70% at 50% 100%, var(--backdrop), var(--background) 75%);
  mask-image: linear-gradient(to top, #000 45%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, #000 45%, transparent 100%);
  pointer-events: none;
}

/* Contact */

.contact {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  gap: 1.5rem;
  margin-block: clamp(4.5rem, 9vw, 7rem) clamp(5rem, 10vw, 8rem);
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 0;
  border-radius: 1.75rem;
  background: var(--surface);
  box-shadow: 0 .3rem 1rem var(--shadow);
}

.contact-copy { display: grid; align-content: start; gap: 1rem; padding: .25rem; }
.contact h2 { font-size: clamp(2.2rem, 4.2vw, 3.2rem); }
.contact .actions { margin-top: 1.2rem; }

.contact-card {
  display: grid; place-content: center; justify-items: center; gap: .35rem;
  min-height: 14rem;
  border: 0; border-radius: 1.2rem;
  background: var(--surface);
  font-size: .84rem;
}

.socials { display: flex; gap: .6rem; margin-bottom: 1rem; }
.socials a {
  display: grid; width: 2.6rem; height: 2.6rem; place-items: center;
  border: 0; border-radius: .7rem;
  color: var(--muted);
}
.socials a:hover { color: var(--foreground); background: var(--subtle); }
.contact-card .faint { color: var(--faint); font-size: .78rem; }

/* Responsive */

@media (max-width: 52rem) {
  .hero-backdrop { --hole: radial-gradient(ellipse 60% 22% at 40% 38%, transparent 20%, #000 100%); }
  .hero { grid-template-columns: 1fr; padding-top: 6.5rem; }
  .hero-umbrella { justify-self: center; width: min(100%, 26rem); margin: -1rem 0 -2rem; }
  .hero-backdrop { --shelter: linear-gradient(#000, #000); }
  .polaroids { row-gap: 1.2rem; }
  .contact { grid-template-columns: 1fr; }
  .project-wide { grid-template-columns: 1fr; }
  .project-wide-copy { padding: 0; }
}

@media (max-width: 38rem) {
  .project-grid { grid-template-columns: 1fr; }
  .polaroids { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-pill a { padding-inline: .7rem; }
}

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