/* =============================================================================
   PieCed — Swiss Industrial
   Dark neutral base · sharp teal accent · honeycomb geometry.
   Tokens mirror the PieCed portal globals.css 1:1.
   ============================================================================= */

:root {
  /* Surfaces */
  --surface-0: #0a0c10;
  --surface-1: #12151c;
  --surface-2: #1a1e28;
  --surface-3: #242a36;

  /* Text */
  --text-primary: #e8ecf4;
  --text-secondary: #8892a4;
  --text-muted: #565e6e;

  /* Accent (brand emerald #10B981, accent token #00d4aa) */
  --accent: #00d4aa;
  --accent-dim: #00b892;
  --accent-glow: #00d4aa26;

  /* Borders */
  --border: #1e2330;
  --border-active: #2c3344;

  /* Status */
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;

  /* Type */
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Rhythm */
  --maxw: 1140px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 10px;

  --header-h: 72px;
  --header-h-condensed: 58px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----------------------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }

::selection { background: var(--accent); color: var(--surface-0); }

/* ----------------------------------------------------------------------------- Layout helpers */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(4.5rem, 10vw, 8rem); position: relative; }
.section--tight { padding-block: clamp(3rem, 7vw, 5rem); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

.section-title { font-size: clamp(1.9rem, 4.5vw, 3rem); max-width: 18ch; }
.section-lead { color: var(--text-secondary); max-width: 56ch; margin-top: 1.1rem; font-size: 1.06rem; }

/* ----------------------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 500; font-size: 0.95rem;
  padding: 0.78rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--accent); color: var(--surface-0); }
.btn--primary:hover { background: var(--accent-dim); transform: translateY(-2px); box-shadow: 0 10px 30px -8px var(--accent); }
.btn--ghost { color: var(--text-primary); border-color: var(--border-active); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--sm { padding: 0.5rem 0.95rem; font-size: 0.85rem; }

/* ----------------------------------------------------------------------------- Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: height 0.3s var(--ease), background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.site-header.is-scrolled {
  height: var(--header-h-condensed);
  background: color-mix(in srgb, var(--surface-1) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand__mark { height: 30px; width: auto; color: var(--accent); transition: color 0.2s, transform 0.4s var(--ease); }
.brand:hover .brand__mark { color: var(--accent-dim); transform: rotate(-6deg); }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand__tag { font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
@media (max-width: 560px) { .brand__tag { display: none; } }

.nav { display: flex; align-items: center; gap: 0.4rem; }
.nav a { color: var(--text-secondary); font-size: 0.92rem; padding: 0.4rem 0.75rem; border-radius: 8px; transition: color 0.2s, background 0.2s; }
.nav a:hover { color: var(--text-primary); background: var(--surface-2); }
.header-cta { display: flex; align-items: center; gap: 0.7rem; }

.nav-toggle { display: none; background: none; border: 0; padding: 0.5rem; color: var(--text-primary); }
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 880px) {
  .nav, .header-cta .btn--ghost { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.is-open {
    display: flex; flex-direction: column; align-items: stretch;
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--surface-1); border-bottom: 1px solid var(--border);
    padding: 1rem var(--gutter) 1.5rem; gap: 0.25rem;
  }
  .nav.is-open a { padding: 0.85rem 0.5rem; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
}

/* ----------------------------------------------------------------------------- Honeycomb background */
.hex-field { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5; }
.bg-glow {
  position: absolute; z-index: 0; pointer-events: none;
  width: 60vw; max-width: 760px; aspect-ratio: 1;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  filter: blur(8px);
}
.bg-noise::after {
  content: ""; position: absolute; inset: 0; z-index: 1; opacity: 0.035; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ----------------------------------------------------------------------------- Hero */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}
.hero .container { position: relative; z-index: 2; }
.hero__glow-1 { top: -10%; right: -8%; }
.hero__glow-2 { bottom: -20%; left: -15%; opacity: 0.6; }
.hero__inner { max-width: 760px; }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
  letter-spacing: -0.035em;
  margin-top: 1.4rem;
}
.hero h1 .accent { color: var(--accent); position: relative; }
.hero__sub { color: var(--text-secondary); font-size: clamp(1.05rem, 2.2vw, 1.3rem); max-width: 52ch; margin-top: 1.6rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.4rem; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 1.6rem 2.4rem; margin-top: 3.2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.hero__meta-item .k { font-family: var(--font-mono); color: var(--accent); font-size: 1.5rem; font-weight: 500; }
.hero__meta-item .v { color: var(--text-muted); font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; margin-top: 0.25rem; }

.scroll-cue {
  position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  z-index: 2; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.2em; text-transform: uppercase; display: flex; flex-direction: column;
  align-items: center; gap: 0.6rem;
}
.scroll-cue .line { width: 1px; height: 38px; background: linear-gradient(var(--accent), transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 40% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1) translateY(38px); opacity: 0; } }

/* ----------------------------------------------------------------------------- Split offer (consulting / hosting) */
.offer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 3rem; }
@media (max-width: 820px) { .offer-grid { grid-template-columns: 1fr; } }
.offer-card {
  position: relative; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(1.6rem, 3vw, 2.4rem); overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.offer-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent); transform: scaleX(0);
  transform-origin: left; transition: transform 0.4s var(--ease);
}
.offer-card:hover { transform: translateY(-4px); border-color: var(--border-active); box-shadow: 0 20px 50px -24px #000; }
.offer-card:hover::before { transform: scaleX(1); }
.offer-card__hex { color: var(--accent); width: 44px; height: 44px; margin-bottom: 1.3rem; }
.offer-card h3 { font-size: 1.5rem; }
.offer-card p { color: var(--text-secondary); margin-top: 0.8rem; }
.offer-card ul { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 0.7rem; }
.offer-card li { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--text-secondary); font-size: 0.95rem; }
.offer-card li::before { content: ""; flex: 0 0 auto; width: 9px; height: 10px; margin-top: 0.45rem; background: var(--accent); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.offer-card .btn { margin-top: 1.8rem; }

/* ----------------------------------------------------------------------------- Feature grid */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 3rem; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.feature:hover { transform: translateY(-3px); border-color: var(--border-active); background: var(--surface-2); }
.feature__icon {
  width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 1rem;
  color: var(--accent); background: var(--accent-glow); border-radius: 10px;
}
.feature__icon svg { width: 20px; height: 20px; }
.feature h4 { font-size: 1.12rem; }
.feature p { color: var(--text-secondary); font-size: 0.93rem; margin-top: 0.5rem; }

/* ----------------------------------------------------------------------------- Steps */
.steps { margin-top: 3rem; display: grid; gap: 0; position: relative; }
.step { display: grid; grid-template-columns: 64px 1fr; gap: 1.4rem; padding-block: 1.6rem; position: relative; }
.step:not(:last-child)::after { content: ""; position: absolute; left: 31px; top: 60px; bottom: -4px; width: 1px; background: var(--border); }
.step__num {
  width: 64px; height: 64px; display: grid; place-items: center; position: relative; z-index: 1;
  font-family: var(--font-mono); font-size: 1.15rem; color: var(--accent);
  background: var(--surface-1); border: 1px solid var(--border-active);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.step h4 { font-size: 1.25rem; }
.step p { color: var(--text-secondary); margin-top: 0.5rem; max-width: 60ch; }

/* ----------------------------------------------------------------------------- Tech strip */
.tech-strip { border-block: 1px solid var(--border); background: var(--surface-1); }
.tech-strip .container { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2.4rem; justify-content: center; padding-block: 2.2rem; }
.tech-strip .label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); }
.tech-strip .item { font-family: var(--font-display); font-weight: 500; color: var(--text-secondary); font-size: 1rem; opacity: 0.85; transition: color 0.2s, opacity 0.2s; }
.tech-strip .item:hover { color: var(--accent); opacity: 1; }

/* ----------------------------------------------------------------------------- CTA band */
.cta-band { position: relative; overflow: hidden; }
.cta-band .panel {
  position: relative; z-index: 2; background: var(--surface-1); border: 1px solid var(--border-active);
  border-radius: calc(var(--radius) + 4px); padding: clamp(2.4rem, 6vw, 4.5rem);
  text-align: center; overflow: hidden;
}
.cta-band .panel .bg-glow { top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0.7; }
.cta-band h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); position: relative; z-index: 2; }
.cta-band p { color: var(--text-secondary); margin: 1rem auto 0; max-width: 48ch; position: relative; z-index: 2; }
.cta-band .hero__actions { justify-content: center; position: relative; z-index: 2; }

/* ----------------------------------------------------------------------------- Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface-1); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand__mark { height: 34px; }
.footer-brand p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 1rem; max-width: 34ch; }
.footer-col h5 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 1rem; }
.footer-col a, .footer-col span { display: block; color: var(--text-secondary); font-size: 0.92rem; padding-block: 0.3rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.82rem; }
.footer-bottom .status { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); }
.footer-bottom .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ----------------------------------------------------------------------------- Generic content (blog / pages) */
.page-hero { padding-top: calc(var(--header-h) + 3rem); padding-bottom: 2rem; position: relative; overflow: hidden; }
.content-narrow { max-width: 740px; }
.prose { color: var(--text-secondary); }
.prose h2 { color: var(--text-primary); font-size: 1.8rem; margin-top: 2.5rem; }
.prose h3 { color: var(--text-primary); font-size: 1.35rem; margin-top: 2rem; }
.prose p, .prose ul, .prose ol { margin-top: 1.1rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: var(--radius); margin-block: 1.6rem; }
.prose blockquote { border-left: 2px solid var(--accent); padding-left: 1.2rem; margin: 1.6rem 0; color: var(--text-primary); }
.prose code { font-family: var(--font-mono); background: var(--surface-2); padding: 0.15em 0.4em; border-radius: 6px; font-size: 0.88em; }
.post-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.05em; }

/* ----------------------------------------------------------------------------- Scroll reveal */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: 0.08s; }
[data-reveal][data-delay="2"] { transition-delay: 0.16s; }
[data-reveal][data-delay="3"] { transition-delay: 0.24s; }
[data-reveal][data-delay="4"] { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}
