/* ===== Tobey Tobias portfolio ===== */

:root {
  --bg: #ffffff;
  --ink: #141414;
  --muted: #6b6b6b;
  --line: #e7e7e7;
  --accent: #1a1a1a;
  --ph-bg: #fff6da;
  --ph-ink: #8a6d00;
  --max: 1600px;
  --pad: clamp(1.25rem, 3.5vw, 3.25rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem var(--pad);
  background: #0c28e1;
  border-bottom: none;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.wordmark-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #ffffff;
  display: inline-block;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.2vw, 2rem);
  font-weight: 600;
  font-size: 1.12rem;
}

.nav a {
  position: relative;
  padding: 0.2rem 0;
  color: #ffffff;
  opacity: 0.92;
  transition: opacity 0.15s ease;
}

.nav a:hover { opacity: 1; }

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: width 0.2s ease;
}

.nav a:hover::after { width: 100%; }

/* ===== Layout ===== */
main { display: block; }

.hero,
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ===== Hero ===== */
.hero {
  padding-top: clamp(1.5rem, 3.5vw, 3rem);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.hero-text {
  margin: 0;
  font-size: clamp(1.44rem, 4vw, 3.5rem);
  line-height: 1.17;
  font-weight: 400;
  letter-spacing: -0.022em;
  max-width: none;
}

.hero-text strong { font-weight: 600; }

/* placeholder inline marker */
.ph {
  background: var(--ph-bg);
  color: var(--ph-ink);
  font-weight: 600;
  border-radius: 0.3em;
  padding: 0 0.25em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ===== Sections ===== */
.section {
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
}

.section-label {
  margin: 0 0 1.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.65fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.about-lead {
  margin: 0;
  font-size: clamp(1.35rem, 2.7vw, 2.1rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.about-body {
  color: #333333;
}

.about-body p {
  margin: 0 0 1.1rem;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  line-height: 1.62;
}

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

/* ===== Work / cases ===== */
.cases {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.case {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.6rem 1.7rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fcfcfc;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.case:hover {
  transform: translateY(-3px);
  border-color: #d2d2d2;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.case-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.case-title {
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.case-cta {
  margin-top: auto;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.work-more {
  margin-top: 2.2rem;
}

.btn-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.7rem;
  border: 1px solid var(--ink);
  border-radius: 2rem;
  font-weight: 700;
  font-size: 0.98rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-more:hover {
  background: var(--ink);
  color: #ffffff;
}

/* ===== Previous work carousel ===== */
.work-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
}

.work-header .section-label {
  margin: 0;
}

.carousel-nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.carousel-count {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.car-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.car-btn:hover {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.carousel {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  align-items: stretch;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-page {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  align-content: start;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.7rem;
}

.dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #cfcfcf;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.dot.is-active {
  background: var(--ink);
  transform: scale(1.3);
}

@media (max-width: 700px) {
  .carousel-page { grid-template-columns: 1fr; }
}

/* ===== Project modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 32, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 1.2rem;
  padding: 2.3rem 2.3rem 2.5rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.is-open .modal-card {
  transform: none;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  width: 38px;
  height: 38px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #444444;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: #e2e2e2;
}

.modal-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0c28e1;
  margin-bottom: 0.7rem;
}

.modal-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  padding-right: 2rem;
}

.modal-client {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.modal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.7rem;
}

.modal-stat {
  padding: 0.5rem 0.9rem;
  background: #f5f6f9;
  border-radius: 0.6rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.modal-subhead {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal-list {
  margin: 0 0 1.7rem;
  padding-left: 1.1rem;
}

.modal-list li {
  margin-bottom: 0.55rem;
  line-height: 1.5;
}

.modal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.modal-tools span {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

/* ===== Two column ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.two-col .section-label { margin-bottom: 1.2rem; }

.tri-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 4.5vw, 3.5rem);
}

.tri-col .section-label { margin-bottom: 1.2rem; }

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.02rem, 1.5vw, 1.22rem);
  font-weight: 600;
}

.list li:last-child { border-bottom: none; }

/* ===== Tools ===== */
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tools li {
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.98rem;
}

.stack-note {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-weight: 500;
}

/* ===== Tools marquee ===== */
.logos {
  overflow: hidden;
  padding: 1.8rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.logos-track {
  display: flex;
  align-items: center;
  gap: clamp(2.4rem, 5.5vw, 5rem);
  width: max-content;
  animation: logo-scroll 42s linear infinite;
}

.logos:hover .logos-track {
  animation-play-state: paused;
}

.logos-track img {
  height: 30px;
  width: auto;
  flex: 0 0 auto;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.logos-track img:hover {
  opacity: 1;
}

.logo-text {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: #4a4a4a;
  white-space: nowrap;
  opacity: 0.72;
}

@keyframes logo-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .logos-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    row-gap: 1.5rem;
  }
}

/* ===== Testimonial ===== */
.quote {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.quote cite {
  display: block;
  margin-top: 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-style: normal;
  color: var(--muted);
}

/* ===== Recommendations ===== */
.recs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.rec {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.6rem 1.6rem 1.7rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fcfcfc;
}

.rec-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.rec-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  position: relative;
  background: #d8dee9;
}

.rec-avatar::before {
  content: "";
  position: absolute;
  inset: -25%;
  filter: blur(6px);
}

/* 4 avatar variants, cycled so neighbours never match */
.rec:nth-child(4n + 1) .rec-avatar::before {
  background:
    radial-gradient(circle at 50% 34%, #e8c7a4 0 26%, transparent 30%),
    radial-gradient(circle at 50% 102%, #aab6cd 0 46%, transparent 62%),
    linear-gradient(160deg, #d2dae8, #aab5cc);
}

.rec:nth-child(4n + 2) .rec-avatar::before {
  background:
    radial-gradient(circle at 47% 36%, #d2a07a 0 26%, transparent 30%),
    radial-gradient(circle at 50% 102%, #b9c2a8 0 46%, transparent 62%),
    linear-gradient(160deg, #dfe2d2, #b3bda0);
}

.rec:nth-child(4n + 3) .rec-avatar::before {
  background:
    radial-gradient(circle at 52% 33%, #f0d3b0 0 26%, transparent 30%),
    radial-gradient(circle at 50% 102%, #c3b4cf 0 46%, transparent 62%),
    linear-gradient(160deg, #e3dcea, #bcabce);
}

.rec:nth-child(4n + 4) .rec-avatar::before {
  background:
    radial-gradient(circle at 49% 35%, #c08a5e 0 26%, transparent 30%),
    radial-gradient(circle at 50% 102%, #a6c2c0 0 46%, transparent 62%),
    linear-gradient(160deg, #cfe0de, #9fbbb8);
}

.rec-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rec-name {
  font-weight: 700;
  font-size: 1rem;
}

.rec-role {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.3;
}

.rec-quote {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.5;
  color: #333333;
}

@media (max-width: 980px) {
  .recs { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .recs { grid-template-columns: 1fr; }
}

/* ===== Contact ===== */
.contact-line {
  margin: 0 0 1.6rem;
  font-size: clamp(1.3rem, 2.6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 22ch;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin-top: 2.2rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.contact-links a {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
}

.contact-links a:hover { opacity: 0.65; }

.contact-grid {
  display: flex;
  align-items: center;
  gap: clamp(1.8rem, 5vw, 4rem);
  flex-wrap: wrap;
}

.contact-grid .contact-line {
  margin: 0;
}

.contact-image {
  display: flex;
  justify-content: flex-end;
}

.contact-image img {
  width: 280px;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: 1rem;
  display: block;
}

@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-image { justify-content: flex-start; }
  .contact-image img { width: 260px; }
}

/* ===== Footer ===== */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem var(--pad) 3.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

/* placeholder elements get a soft dashed hint */
[data-placeholder] { position: relative; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .cases { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .tri-col { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 980px) and (min-width: 821px) {
  .tri-col { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; }
}

@media (max-width: 560px) {
  .site-header {
    gap: 0.6rem 0.8rem;
    padding: 0.85rem var(--pad);
  }
  .wordmark { font-size: 1.12rem; gap: 0.45rem; }
  .wordmark-dot { width: 1.2rem; height: 1.2rem; }
  .nav { font-size: 0.9rem; gap: 0.75rem; }
  .hero-text { max-width: 100%; }
  .car-btn { width: 40px; height: 40px; font-size: 1.05rem; }
  .modal { padding: 0.9rem; }
  .modal-card { padding: 1.8rem 1.4rem 1.9rem; border-radius: 1rem; }
  .modal-title { padding-right: 1.6rem; }
  .modal-stat { font-size: 0.85rem; }
}
