/* =========================================================
   Ted & Rob — single-page site
   Dark-only, dense, intentional.
   ========================================================= */

:root {
  --bg:        #0a0a0a;
  --bg-2:     #161616;
  --bg-3:     #202020;
  --line:     #242424;
  --line-2:   #303030;
  --text:     #ededed;      /* soft white, not harsh */
  --text-dim: #9a9a9a;
  --text-mut: #6f6f6f;
  --accent:   #ff000d;
  --accent-2: #ff3941;
  --radius:   2px;
  --maxw:     1280px;
  --pad-x:    clamp(20px, 5vw, 64px);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a {
  color: var(--text);
  text-decoration: none;
  transition: color 160ms ease;
}
a:hover { color: var(--accent); }

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

::selection { background: var(--accent); color: #fff; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---------- Topbar / Hamburger ---------- */
.topbar {
  position: absolute;   /* NOT sticky */
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: flex-end;
  padding: 22px var(--pad-x);
  z-index: 20;
}

.menu-toggle {
  --size: 44px;
  width: var(--size); height: var(--size);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: var(--radius);
  transition: background-color 180ms ease;
}
.menu-toggle .bar {
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: background-color 180ms ease, transform 250ms ease, opacity 200ms ease;
}
.menu-toggle:hover .bar { background: var(--accent); }
.menu-toggle:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* When menu open, morph hamburger to X (only on the toggle when open) */
body.menu-open .menu-toggle .bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.menu-open .menu-toggle .bar:nth-child(2) { opacity: 0; }
body.menu-open .menu-toggle .bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Menu overlay ---------- */
.menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(50vw, 560px);
  background: #161616;
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(.4,.0,.2,1);
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 96px 56px 40px;
  visibility: hidden;
}
body.menu-open .menu-overlay {
  transform: translateX(0);
  visibility: visible;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 35;
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}
body.menu-open .menu-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.menu-close {
  position: absolute;
  top: 26px; right: 26px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
}
.menu-close .x-bar {
  position: absolute;
  width: 22px; height: 1.5px;
  background: var(--text);
  transition: background-color 180ms ease;
}
.menu-close .x-bar:first-child { transform: rotate(45deg); }
.menu-close .x-bar:last-child  { transform: rotate(-45deg); }
.menu-close:hover .x-bar { background: var(--accent); }

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: auto;
  margin-bottom: auto;
}
.menu-nav a {
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  position: relative;
  width: max-content;
  transition: color 200ms ease, transform 250ms ease;
}
.menu-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms cubic-bezier(.4,.0,.2,1);
}
.menu-nav a:hover {
  color: var(--accent);
  transform: translateX(6px);
}
.menu-nav a:hover::after { transform: scaleX(1); }

.menu-footer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.menu-person {
  display: flex;
  align-items: center;
  gap: 12px;
}
.menu-person .who {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mut);
  min-width: 36px;
}
.menu-person a {
  display: inline-flex;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-dim);
  transition: color 180ms ease, background-color 180ms ease;
}
.menu-person a:hover { color: var(--accent); }
.menu-person a svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  padding: clamp(64px, 9vh, 104px) var(--pad-x) clamp(28px, 5vh, 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  width: 100%;
  max-width: 1480px;
  gap: clamp(8px, 2vw, 28px);
}

.headshot {
  margin: 0;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  position: relative;
}
.headshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The headshots already sit on near-black; lighten blends them into the page bg */
  mix-blend-mode: lighten;
  filter: contrast(1.05) saturate(0.95);
  /* Soft circular fade so the faces dissolve into black */
  -webkit-mask-image: radial-gradient(ellipse at center, #000 45%, transparent 78%);
          mask-image: radial-gradient(ellipse at center, #000 45%, transparent 78%);
  /* Held invisible until the image decodes; JS adds .is-loaded to fade in cleanly */
  opacity: 0;
  transition: opacity 1100ms ease;
}
.headshot img.is-loaded { opacity: 1; }
.headshot-rob img { object-position: center 30%; }
.headshot-ted img { object-position: center 30%; }

.hero-title {
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.9;
  font-size: clamp(72px, 13.5vw, 208px);
  text-align: center;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.02em;
  color: var(--text);
  text-shadow: 0 0 60px rgba(0,0,0,0.6);
}
.hero-title .amp {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.65em;
  line-height: 1;
}

.newsletter-form input[type="email"] {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  padding: 14px 18px;
  outline: none;
  min-width: 0;
}
.newsletter-form input::placeholder {
  color: var(--text-mut);
}

.cta {
  background: var(--text);
  color: #111;
  padding: 0 22px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 0;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.cta svg { width: 16px; height: 16px; stroke: currentColor; transition: transform 220ms ease; }
.cta:hover {
  background: var(--accent);
  color: #fff;
}
.cta:hover svg { transform: translateX(3px); }
.cta:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* Hero CTA — standalone button-link */
.cta-hero {
  margin-top: clamp(20px, 3.5vh, 44px);
  padding: 18px 28px;
  font-size: clamp(15px, 1.4vw, 17px);
  letter-spacing: -0.005em;
  border-radius: var(--radius);
  align-self: center;
}
.cta-hero svg { width: 18px; height: 18px; }

.form-status {
  position: absolute;
  left: 4px;
  top: calc(100% + 8px);
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  min-height: 18px;
}
.form-status.is-error { color: var(--accent-2); }
.form-status.is-ok    { color: #6dd2a1; }

/* ---------- Section base ---------- */
.section {
  padding: clamp(72px, 12vh, 140px) var(--pad-x);
  max-width: var(--maxw);
  margin: 0 auto;
}

.section-head {
  margin-bottom: clamp(28px, 5vh, 56px);
}
.section-head h2 {
  font-size: clamp(36px, 5.4vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 12px;
}
.section-sub {
  margin: 0;
  color: var(--text-dim);
  font-size: clamp(15px, 1.3vw, 17px);
  max-width: 60ch;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 880ms ease,
    transform 1050ms cubic-bezier(.2,.6,.2,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Blog ---------- */
.blog-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 48px);
}
.blog-entry {
  display: flex;
  flex-direction: column;
  gap: 18px;
  cursor: pointer;
  transition: transform 260ms ease;
}
.blog-entry:hover { transform: translateY(-3px); }

.blog-thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  background: linear-gradient(135deg, #2a2a2a 0%, #161616 100%);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: border-color 220ms ease;
}
.blog-entry:hover .blog-thumb { border-color: var(--accent); }
.blog-thumb::after {
  content: attr(data-tag);
  position: absolute;
  left: 14px; top: 14px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mut);
}
.blog-thumb::before {
  content: "";
  position: absolute;
  inset: 30% 30%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.04), transparent 65%);
}

/* When the entry has a real image, swap the gradient placeholder for it. */
.blog-thumb.has-image { background: #0d0d0d; }
.blog-thumb.has-image::before { content: none; }
.blog-thumb.has-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(0.95);
  transition: transform 600ms cubic-bezier(.2,.6,.2,1), filter 300ms ease;
}
.blog-thumb.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}
.blog-entry:hover .blog-thumb.has-image img {
  transform: scale(1.04);
  filter: saturate(1) contrast(1);
}
.blog-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mut);
}
.blog-meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: var(--line-2);
}
.blog-title {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 600;
}
.blog-entry:hover .blog-title { color: var(--accent); }
.blog-excerpt {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(16px, 2vw, 28px);
  min-height: 560px;
}
.project-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #262626 0%, #161616 100%);
  display: flex;
  align-items: flex-end;
  padding: clamp(20px, 2vw, 32px);
  transition: border-color 240ms ease, transform 320ms ease;
  cursor: pointer;
  isolation: isolate;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 70% 30%, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(60% 50% at 20% 80%, rgba(255,0,13,0.05), transparent 60%);
  z-index: -1;
  transition: opacity 320ms ease;
}
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.55) 100%);
  z-index: -1;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.project-card:hover::before { opacity: 0.6; }

.project-card:nth-child(1) { grid-row: 1 / 3; grid-column: 1; }
.project-card:nth-child(2) { grid-row: 1; grid-column: 2; }
.project-card:nth-child(3) { grid-row: 2; grid-column: 2; }

.project-card-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mut);
}
.project-title {
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
}
.project-card:hover .project-title { color: var(--accent); }
.project-desc {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 50ch;
}

.extra-links {
  margin-top: clamp(32px, 6vh, 56px);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.extra-btn {
  --btn-pad-y: 18px;
  --btn-pad-x: 28px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text);
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius);
  min-width: 220px;
  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease,
    transform 220ms ease;
}
.extra-btn svg {
  width: 22px; height: 22px;
  fill: currentColor;
  stroke: currentColor;
  transition: transform 220ms ease;
}
.extra-btn .arrow { margin-left: auto; }
.extra-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.extra-btn:hover .arrow { transform: translateX(4px); }
.extra-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* Projects "coming soon" placeholder. Lives in [data-project-grid]
   when content.projectsComingSoon is true. */
.project-grid.is-coming-soon {
  display: block;
  min-height: 0;
}
.coming-soon-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
  padding: clamp(56px, 10vw, 120px) clamp(24px, 5vw, 64px);
  text-align: center;
  border-radius: var(--radius);
}
.coming-soon-card::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(255,0,13,0.06), transparent 60%),
    radial-gradient(50% 40% at 70% 80%, rgba(255,255,255,0.04), transparent 60%);
  z-index: -1;
}
.cs-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px 12px;
  margin-bottom: 24px;
}
.cs-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 14px;
}
.cs-desc {
  margin: 0 auto;
  max-width: 48ch;
  color: var(--text-dim);
  font-size: clamp(15px, 1.3vw, 17px);
}

/* ---------- Newsletter ---------- */
.newsletter {
  text-align: center;
}
.newsletter .section-head { text-align: center; }
.newsletter .section-sub { margin-inline: auto; }
.newsletter-form {
  margin: 0 auto;
  width: min(540px, 100%);
  display: flex;
  background: #181818;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  transition: border-color 180ms ease, box-shadow 200ms ease;
}
.newsletter-form:focus-within {
  border-color: var(--line-2);
  box-shadow: 0 0 0 3px rgba(255, 0, 13, 0.10);
}

/* ---------- Contact ---------- */
.contact-emails {
  list-style: none;
  padding: 0; margin: 0 0 clamp(28px, 5vh, 48px);
  border-top: 1px solid var(--line);
}
.contact-emails li {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(18px, 2vw, 26px);
}
.contact-emails a {
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color 180ms ease;
}
.contact-emails a:hover { color: var(--accent); }

.contact-socials {
  display: flex;
  gap: clamp(24px, 5vw, 64px);
  flex-wrap: wrap;
}
.person-socials {
  display: flex;
  align-items: center;
  gap: 14px;
}
.person-socials .who {
  color: var(--text-mut);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-right: 4px;
}
.person-socials a {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.person-socials a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.person-socials svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px var(--pad-x) 56px;
  color: var(--text-mut);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 880px) {
  .blog-list { grid-template-columns: 1fr; }
  .project-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
  }
  .project-card:nth-child(1),
  .project-card:nth-child(2),
  .project-card:nth-child(3) {
    grid-row: auto; grid-column: auto;
    min-height: 220px;
  }
  .menu-overlay {
    width: 100vw;
    padding: 96px 32px 32px;
  }
  .extra-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  :root { --pad-x: 20px; }

  .hero {
    padding-top: 96px;
  }
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "rob ted"
      "title title";
    align-items: end;
    gap: 6px;
  }
  .headshot-rob { grid-area: rob; max-width: 100%; }
  .headshot-ted { grid-area: ted; max-width: 100%; }
  .headshot { aspect-ratio: 3 / 4; }
  .hero-title {
    grid-area: title;
    font-size: clamp(56px, 18vw, 96px);
    margin-top: 4px;
  }
  .cta-hero {
    width: min(420px, 92%);
    justify-content: center;
  }

  .newsletter-form {
    flex-direction: column;
    background: transparent;
    border: 0;
  }
  .newsletter-form input[type="email"] {
    background: #181818;
    border: 1px solid var(--line);
    padding: 14px 16px;
  }
  .newsletter-form .cta {
    margin-top: 10px;
    padding: 14px 18px;
    justify-content: center;
  }
  .newsletter-form:focus-within { box-shadow: none; }

  .menu-nav { gap: 14px; }
  .menu-nav a { font-size: clamp(38px, 11vw, 60px); }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}
