/* Dim Tech Studio — homepage */

:root {
  --paper: #ece5da;
  --paper-2: #ded6c9;
  --ink: #111110;
  --ink-2: #5d5b55;
  --ink-3: #8c8981;
  --line: rgba(17, 17, 16, 0.14);

  --night: #111110;
  --night-2: #1b1b19;
  --on-night: #f2f0eb;
  --on-night-2: rgba(242, 240, 235, 0.6);
  --line-night: rgba(242, 240, 235, 0.14);

  --accent: #ff5a1f;
  --mint: #b6f2c6;

  --sans: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --radius: clamp(20px, 2.4vw, 32px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Warm gradient backdrop with a faint grain, fixed behind the page */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(70% 55% at 100% 0%, rgba(255, 112, 52, 0.38), transparent 70%),
    radial-gradient(60% 50% at 0% 100%, rgba(150, 190, 168, 0.4), transparent 70%),
    linear-gradient(165deg, #f1e7da 0%, #e7dfd2 45%, #ddd8cd 100%);
}

body::after {
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

ul,
ol {
  list-style: none;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-2);
}

.label span {
  color: var(--ink);
}

.label span::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  margin-left: 12px;
  vertical-align: middle;
  background: currentColor;
  opacity: 0.4;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}

.btn span {
  transition: transform 0.25s var(--ease);
}

.btn:hover span {
  transform: translateX(3px);
}

.btn-sm {
  height: 40px;
  padding: 0 18px;
  font-size: 15px;
}

.btn-ink {
  background: var(--ink);
  color: var(--paper);
}

.btn-ink:hover {
  background: var(--accent);
  color: var(--ink);
}

.btn-line {
  border: 1px solid var(--line);
}

.btn-line:hover {
  border-color: var(--ink);
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}

.site-header.is-scrolled {
  background: rgba(236, 229, 218, 0.6);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 44px;
  height: 44px;
  filter: brightness(0);
  margin-left: -8px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 15px;
  font-weight: 500;
}

.header-nav a:not(.btn) {
  position: relative;
  color: var(--ink-2);
  transition: color 0.2s;
}

.header-nav a:not(.btn):hover {
  color: var(--ink);
}

/* HERO */
.hero {
  padding-top: clamp(56px, 11vh, 120px);
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-2);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.hero-title {
  margin-top: clamp(28px, 5vh, 56px);
  font-size: clamp(46px, 9.2vw, 148px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.hero-title .line {
  display: block;
  overflow: hidden;
  /* Room for descenders (g, p) inside the clipped line */
  padding-bottom: 0.2em;
  margin-bottom: -0.2em;
}

.hero-title .line > span {
  display: inline-block;
}

.hero-title mark {
  background: none;
  color: var(--accent);
}

.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px 48px;
  margin-top: clamp(32px, 6vh, 64px);
}

.hero-sub {
  max-width: 34ch;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* SECTIONS */
.work,
.studio,
.services {
  padding-top: clamp(88px, 14vh, 160px);
}

.section-head {
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-title {
  margin-top: 20px;
  font-size: clamp(36px, 5.2vw, 76px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.section-text {
  margin-top: 24px;
  max-width: 38ch;
  font-size: 18px;
  color: var(--ink-2);
}

/* WORK */
.case {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: center;
  padding: clamp(28px, 4.5vw, 64px);
  border-radius: var(--radius);
  background: var(--night);
  color: var(--on-night);
  overflow: hidden;
  isolation: isolate;
}

.case::before {
  content: "";
  position: absolute;
  inset: auto -10% -40% 35%;
  height: 80%;
  background: radial-gradient(closest-side, rgba(182, 242, 198, 0.16), transparent);
  z-index: -1;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-tags span {
  padding: 6px 12px;
  border: 1px solid var(--line-night);
  border-radius: 999px;
  color: var(--on-night-2);
  font-size: 11px;
}

.case-title {
  margin-top: 28px;
  font-size: clamp(48px, 6.4vw, 96px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--mint);
}

.case-lede {
  margin-top: 28px;
  max-width: 28ch;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.case-body {
  margin-top: 16px;
  max-width: 40ch;
  color: var(--on-night-2);
}

.case-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--on-night-2);
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s;
}

.case-link:hover {
  color: var(--mint);
  border-color: var(--mint);
}

.case-phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 24px);
  align-items: center;
}

.phone {
  border-radius: 13% / 6%;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 30px 60px -20px rgba(0, 0, 0, 0.6);
  transition: transform 0.6s var(--ease);
}

.phone img {
  width: 100%;
  height: auto;
  aspect-ratio: 1320 / 2868;
  object-fit: cover;
}

.phone-side {
  transform: translateY(8%) scale(0.92);
  opacity: 0.9;
}

.phone-main {
  position: relative;
  z-index: 1;
}

.case:hover .phone-side:first-child {
  transform: translateY(6%) scale(0.92) rotate(-2deg);
}

.case:hover .phone-side:last-child {
  transform: translateY(6%) scale(0.92) rotate(2deg);
}

.case:hover .phone-main {
  transform: translateY(-2%);
}

/* STUDIO */
.studio {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: start;
}

.studio-intro {
  position: sticky;
  top: 112px;
}

.people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

.person-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
}

.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  transform: scale(1.12);
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.6s var(--ease), transform 0.8s var(--ease);
}

.person:hover .person-photo img {
  filter: grayscale(0);
  transform: scale(1.16);
}

.person-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 4px 0;
}

.person h3 {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.person p {
  margin-top: 6px;
  color: var(--ink-2);
}

.arrow {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 18px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.person:hover .arrow {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* SERVICES */
.services {
  padding-bottom: clamp(96px, 16vh, 180px);
}

.service-list {
  border-top: 1px solid var(--line);
}

.service {
  display: grid;
  grid-template-columns: 80px minmax(0, 5fr) minmax(0, 6fr);
  gap: 16px 32px;
  align-items: baseline;
  padding: clamp(24px, 3vw, 40px) 0;
  border-bottom: 1px solid var(--line);
}

.service-num {
  color: var(--ink-3);
}

.service h3 {
  font-size: clamp(28px, 3.4vw, 48px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.service p {
  max-width: 46ch;
  font-size: 18px;
  color: var(--ink-2);
}

/* CONTACT */
.contact {
  background: var(--night);
  color: var(--on-night);
  padding-top: clamp(88px, 14vh, 160px);
  border-radius: var(--radius) var(--radius) 0 0;
}

.contact .label {
  color: var(--on-night-2);
}

.contact .label span {
  color: var(--on-night);
}

.contact-title {
  margin-top: 32px;
  font-size: clamp(48px, 8.4vw, 136px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.contact-sub {
  margin-top: 28px;
  font-size: clamp(18px, 1.6vw, 22px);
  color: var(--on-night-2);
}

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: clamp(40px, 7vh, 72px);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  font-size: clamp(22px, 3.4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  word-break: break-word;
  transition: color 0.2s;
}

.contact-mail span {
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}

.contact-mail:hover {
  color: var(--accent);
}

.contact-mail:hover span {
  transform: translate(3px, -3px);
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(88px, 14vh, 160px);
  padding: 28px 0 32px;
  border-top: 1px solid var(--line-night);
  color: var(--on-night-2);
}

.footer-bar nav {
  display: flex;
  gap: 28px;
}

.footer-bar a {
  transition: color 0.2s;
}

.footer-bar a:hover {
  color: var(--on-night);
}

/* MOTION */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.js .hero-title .line > span {
  transform: translateY(105%);
  animation: rise 1s var(--ease) forwards;
}

.js .hero-title .line:nth-child(2) > span { animation-delay: 0.08s; }
.js .hero-title .line:nth-child(3) > span { animation-delay: 0.16s; }

.js .hero-meta,
.js .hero-foot {
  opacity: 0;
  animation: fade 1s var(--ease) 0.35s forwards;
}

@keyframes rise {
  to { transform: none; }
}

@keyframes fade {
  to { opacity: 1; }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .case {
    grid-template-columns: 1fr;
  }

  .case-phones {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
  }

  .studio {
    grid-template-columns: 1fr;
  }

  .studio-intro {
    position: static;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .header-nav {
    gap: 20px;
  }

  .header-nav a:not(.btn) {
    display: none;
  }

  .hero-foot {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .service {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .service p {
    grid-column: 2;
    font-size: 16px;
  }

  .section-text {
    font-size: 16px;
  }

  .footer-bar {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .brand span {
    display: none;
  }

  /* Let the headline wrap naturally instead of fixed lines */
  .hero-title .line,
  .js .hero-title .line > span {
    display: inline;
    transform: none;
    animation: none;
  }

  .js .hero-title {
    opacity: 0;
    animation: fade 1s var(--ease) forwards;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .case-phones {
    gap: 8px;
  }

  .people {
    grid-template-columns: 1fr;
  }

  .person-photo {
    aspect-ratio: 1 / 1;
  }
}
