/* =========================================================================
   Omihon — Main Stylesheet
   Dark, minimal, editorial.
   ========================================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Colour */
  --ink: #0A0A0B;
  --ink-raised: #111113;
  --ink-elevated: #18181B;
  --line: #26262A;
  --line-soft: #1C1C1F;
  --text: #F5F5F3;
  --text-muted: #9A9A96;
  --text-dim: #656561;
  --accent: #E63946;
  --accent-dim: #C82A36;

  /* Typography */
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-body: "IBM Plex Sans", -apple-system, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Scale */
  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-0:  clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  --step-1:  clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --step-2:  clamp(1.375rem, 1.25rem + 0.5vw, 1.625rem);
  --step-3:  clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  --step-4:  clamp(2.25rem, 1.8rem + 2vw, 3.5rem);
  --step-5:  clamp(3rem, 2.2rem + 3.5vw, 5.5rem);
  --step-6:  clamp(3.75rem, 2.5rem + 5vw, 7rem);

  /* Space */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 5rem;
  --space-7: 8rem;

  /* Layout */
  --max: 1240px;
  --max-narrow: 780px;
  --radius: 4px;
  --radius-lg: 8px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

img, picture, video, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Grain overlay — atmosphere */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h1 { font-size: var(--step-6); }
h2 { font-size: var(--step-5); }
h3 { font-size: var(--step-3); }
h4 { font-size: var(--step-2); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mono { font-family: var(--font-mono); }
em, .italic { font-style: italic; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }

p + p { margin-top: 1em; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}
@media (min-width: 768px) {
  .wrap { padding-inline: var(--space-5); }
}

.wrap-narrow {
  width: 100%;
  max-width: var(--max-narrow);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

section { position: relative; z-index: 2; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-2);
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}
.site-brand__mark {
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0;
  position: relative;
  top: -1px;
}
.site-nav { display: none; }
.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
  padding: 0;
}
.site-nav a {
  font-size: var(--step--1);
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}
.site-nav a:hover,
.site-nav .current-menu-item a,
.site-nav .current_page_item a {
  color: var(--text);
}
@media (min-width: 900px) {
  .site-nav { display: block; }
}

/* Mobile menu trigger */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem;
}
.nav-toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
@media (min-width: 900px) { .nav-toggle { display: none; } }

.mobile-nav {
  display: none;
  border-bottom: 1px solid var(--line-soft);
  padding-block: var(--space-2);
}
.mobile-nav[data-open="true"] { display: block; }
.mobile-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mobile-nav a {
  display: block;
  padding-block: 0.5rem;
  font-size: var(--step-1);
  color: var(--text);
}
@media (min-width: 900px) { .mobile-nav { display: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.375rem;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--radius);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn--primary {
  background: var(--text);
  color: var(--ink);
}
.btn--primary:hover {
  background: var(--accent);
  color: var(--text);
}
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--text);
}
.btn__arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-6) var(--space-7);
  position: relative;
  overflow: hidden;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: var(--space-4);
}
.hero__eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
}
.hero h1 {
  max-width: 18ch;
  margin-bottom: var(--space-4);
}
.hero h1 em { color: var(--accent); font-style: italic; }
.hero__sub {
  max-width: 52ch;
  font-size: var(--step-1);
  color: var(--text-muted);
  margin-bottom: var(--space-5);
  line-height: 1.5;
}
.hero__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Decorative hero gradient */
.hero::after {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 140%;
  background: radial-gradient(ellipse at center, rgba(230, 57, 70, 0.08), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* ---------- Section common ---------- */
.section {
  padding-block: var(--space-7);
  border-top: 1px solid var(--line-soft);
}
.section--flush { border-top: 0; }
.section__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  max-width: 60ch;
}
.section__head h2 {
  font-size: var(--step-4);
  max-width: 18ch;
}

/* ---------- Capabilities grid ---------- */
.capabilities {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.capability {
  background: var(--ink);
  padding: var(--space-4);
  transition: background 0.25s ease;
}
.capability:hover { background: var(--ink-raised); }
.capability__number {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-dim);
  margin-bottom: var(--space-3);
}
.capability h3 {
  font-size: var(--step-2);
  margin-bottom: var(--space-2);
}
.capability p {
  color: var(--text-muted);
  font-size: var(--step-0);
}
@media (min-width: 768px) {
  .capabilities { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Work cards ---------- */
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}
.work-card {
  display: block;
  background: var(--ink-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.work-card:hover {
  border-color: var(--line);
  transform: translateY(-2px);
}
.work-card__media {
  aspect-ratio: 16 / 10;
  background: var(--ink-elevated);
  overflow: hidden;
  position: relative;
}
.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.work-card:hover .work-card__media img { transform: scale(1.02); }
.work-card__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
}
.work-card__body {
  padding: var(--space-3) var(--space-4) var(--space-4);
}
.work-card__meta {
  display: flex;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-dim);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.work-card__meta span + span::before {
  content: "·";
  margin-right: var(--space-2);
}
.work-card h3 {
  font-size: var(--step-2);
  margin-bottom: var(--space-2);
}
.work-card p {
  color: var(--text-muted);
  font-size: var(--step-0);
}

/* ---------- Products ---------- */
.products {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
.product-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--ink-raised);
  align-items: start;
  transition: border-color 0.25s ease;
}
.product-row:hover { border-color: var(--line); }
@media (min-width: 768px) {
  .product-row {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
  }
}
.product-row__name {
  font-family: var(--font-display);
  font-size: var(--step-3);
  letter-spacing: -0.01em;
}
.product-row__body { color: var(--text-muted); }
.product-row__tagline {
  font-size: var(--step-1);
  color: var(--text);
  margin-bottom: 0.25rem;
}
.product-row__for {
  font-size: var(--step--1);
  color: var(--text-dim);
}
.product-row__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  white-space: nowrap;
  width: fit-content;
}
.product-row__status[data-status="live"] { color: #6EE7B7; border-color: rgba(110, 231, 183, 0.3); }
.product-row__status[data-status="live"]::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6EE7B7;
  box-shadow: 0 0 8px #6EE7B7;
}
.product-row__status[data-status="in_dev"]::before,
.product-row__status[data-status="launching"]::before,
.product-row__status[data-status="beta"]::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

/* ---------- Approach / prose blocks ---------- */
.prose {
  max-width: 62ch;
  color: var(--text);
  font-size: var(--step-1);
  line-height: 1.65;
}
.prose p { color: var(--text-muted); }
.prose p + p { margin-top: 1.1em; }
.prose strong { color: var(--text); font-weight: 500; }
.prose em { color: var(--text); font-style: italic; }

/* ---------- Services page ---------- */
.services-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line-soft);
  border-block: 1px solid var(--line-soft);
}
.service {
  background: var(--ink);
  padding: var(--space-5) 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 900px) {
  .service {
    grid-template-columns: 1fr 2fr;
    gap: var(--space-5);
    padding-block: var(--space-5);
  }
}
.service__title h3 {
  font-size: var(--step-3);
}
.service__title .eyebrow { margin-bottom: var(--space-2); }
.service__body { color: var(--text-muted); }
.service__body p + p { margin-top: 1em; }
.service__for {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-dim);
}

/* ---------- About ---------- */
.about-hero {
  padding-block: var(--space-6) var(--space-5);
}
.about-hero h1 {
  font-size: var(--step-5);
  max-width: 16ch;
}

.principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .principles { grid-template-columns: repeat(2, 1fr); }
}
.principle {
  padding: var(--space-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
}
.principle__n {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  margin-bottom: var(--space-2);
}
.principle h4 {
  font-size: var(--step-2);
  margin-bottom: var(--space-2);
}
.principle p { color: var(--text-muted); font-size: var(--step-0); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1.2fr 1fr; gap: var(--space-6); }
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.field label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.field input,
.field textarea {
  width: 100%;
  background: var(--ink-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.875rem 1rem;
  font: inherit;
  font-size: var(--step-0);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field input:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  background: var(--ink-elevated);
}
.field textarea { min-height: 140px; resize: vertical; }
.field--hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form__submit {
  align-self: flex-start;
  margin-top: var(--space-2);
}
.contact-form__status {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  min-height: 1.5em;
}
.contact-form__status[data-state="success"] { color: #6EE7B7; }
.contact-form__status[data-state="error"] { color: var(--accent); }

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.contact-meta__block h4 {
  font-size: var(--step-1);
  margin-bottom: 0.5rem;
}
.contact-meta__block p,
.contact-meta__block a {
  color: var(--text-muted);
}
.contact-meta__block a:hover { color: var(--text); }

/* ---------- Single case study ---------- */
.single-hero { padding-block: var(--space-6) var(--space-5); }
.single-hero h1 { max-width: 18ch; margin-bottom: var(--space-3); }
.single-hero__meta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}
.single-hero__meta span + span { border-left: 1px solid var(--line); padding-left: var(--space-3); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 900px) {
  .detail-grid { grid-template-columns: 260px 1fr; gap: var(--space-6); }
}
.detail-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  font-size: var(--step--1);
}
.detail-aside dt {
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35em;
  font-size: 0.75rem;
}
.detail-aside dd { color: var(--text); margin-left: 0; margin-bottom: var(--space-3); }

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
@media (min-width: 768px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
.gallery img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}

/* ---------- CTA block ---------- */
.cta-block {
  border-top: 1px solid var(--line-soft);
  padding-block: var(--space-6);
  text-align: left;
}
.cta-block h3 {
  font-size: var(--step-4);
  max-width: 16ch;
  margin-bottom: var(--space-3);
}
.cta-block p {
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: var(--space-4);
  font-size: var(--step-1);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: var(--space-5) var(--space-4);
  margin-top: var(--space-6);
  position: relative;
  z-index: 2;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
@media (min-width: 768px) {
  .site-footer__grid { grid-template-columns: 1.5fr repeat(3, 1fr); gap: var(--space-5); }
}
.site-footer h5 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-2);
}
.site-footer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.site-footer a {
  color: var(--text-muted);
  font-size: var(--step--1);
}
.site-footer a:hover { color: var(--text); }
.site-footer__bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}
@media (min-width: 768px) {
  .site-footer__bar { flex-direction: row; justify-content: space-between; }
}
.site-footer__address { color: var(--text-muted); font-size: var(--step--1); font-family: var(--font-body); line-height: 1.7; }

/* ---------- Animations ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.7s ease forwards; opacity: 0; }
.rise--1 { animation-delay: 0.05s; }
.rise--2 { animation-delay: 0.15s; }
.rise--3 { animation-delay: 0.25s; }
.rise--4 { animation-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Utility ---------- */
.u-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.u-mt-4 { margin-top: var(--space-4); }
.u-mt-5 { margin-top: var(--space-5); }
.u-stack-3 > * + * { margin-top: var(--space-3); }
