/* ==========================================================================
   PIU TECH LABS — landing page
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --accent: #C6F35E;          /* lime — change to restyle the whole page */
  --bg: #0A0B0D;
  --surface: #0E1013;
  --surface-hover: #111317;
  --line: #1F2328;
  --line-strong: #2A2F35;
  --line-button: #3A3F46;
  --text: #ECEDEE;
  --text-white: #FFFFFF;
  --text-soft: #C9CED4;
  --text-muted: #A3AAB3;
  --text-dim: #9198A1;
  --text-faint: #7D848D;

  --font-sans: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1280px;
  --gutter: 40px;
  --grid-size: 80px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin: 0; }

a { color: var(--text); }
a:hover { color: var(--text-white); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

svg { display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ---------- Shared bits ---------- */
.label,
.eyebrow,
.section-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.label { color: var(--accent); }
.eyebrow { color: var(--text-dim); letter-spacing: 0.08em; }
.section-meta { color: var(--text-dim); }

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

.stack-48 { display: flex; flex-direction: column; gap: 48px; }

.t-accent { color: var(--accent); }
.t-white  { color: var(--text-white); }
.t-muted  { color: var(--text-dim); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 28px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: filter .2s ease, transform .2s ease;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { color: var(--bg); filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); }

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { width: 10px; height: 10px; background: var(--accent); }
.brand-name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.nav-link { color: var(--text-muted); text-decoration: none; }
.nav-link:hover { color: var(--text); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-button);
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s ease;
}
.nav-cta:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }

.hero-inner {
  padding-top: 120px;
  padding-bottom: 120px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 64px;
}

.hero-copy {
  flex: 1 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero-title {
  font-size: clamp(44px, 6.2vw, 92px);
  line-height: 0.96;
  font-weight: 600;
  letter-spacing: -0.045em;
  max-width: 11ch;
  text-wrap: balance;
}

.hero-lead {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 32ch;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 8px; }

.hero-visual { position: relative; flex: 1 1 520px; min-width: 0; }

.hero-glow {
  position: absolute;
  inset: -60px;
  background: radial-gradient(closest-side, var(--accent), transparent);
  opacity: 0.12;
  filter: blur(30px);
  animation: glow 6s ease-in-out infinite;
  pointer-events: none;
}

/* ---------- Terminal (hero + contact) ---------- */
.terminal {
  position: relative;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.hero .terminal { box-shadow: 0 40px 80px rgba(0,0,0,0.5); }

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}
.terminal-dots { display: flex; gap: 8px; }
.terminal-dots span { width: 10px; height: 10px; border: 1px solid var(--line-button); }
.terminal-dots .is-accent { background: var(--accent); border-color: var(--accent); }

.terminal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 26px 30px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-soft);
}
.hero .terminal-body { min-height: 380px; }

/* Lines are fully visible by default; the loop re-types them.
   Negative delays (--d) start each line mid-cycle so the log is complete on load. */
.ln { animation: lineIn 12s ease-out infinite both; animation-delay: var(--d, 0s); }
.ln-row { display: flex; justify-content: space-between; gap: 16px; }
.ln-progress { padding: 6px 0; }

.progress { height: 4px; background: var(--line); }
.progress-fill {
  width: 100%;
  height: 4px;
  background: var(--accent);
  animation: bar 12s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.caret {
  display: inline-block;
  width: 9px;
  height: 18px;
  margin-left: 6px;
  vertical-align: -3px;
  background: var(--text-soft);
  animation: caret 1.1s steps(1) infinite;
}
.caret-accent { background: var(--accent); animation-duration: 1s; }

/* ---------- What we do ---------- */
.section-what .container { padding-top: 104px; padding-bottom: 104px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.service {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 300px;
  padding: 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: background-color .2s ease;
}
.service:hover { background: var(--surface-hover); }

.service-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: auto;   /* pushes title + text to the bottom of the cell */
}
.service-index { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.service-icon {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-title { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; }
.service-text { font-size: 16px; line-height: 1.55; color: var(--text-muted); }

/* ---------- About ---------- */
.about-inner {
  padding-top: 112px;
  padding-bottom: 112px;
  display: flex;
  flex-wrap: wrap;
  gap: 48px 64px;
}
.about-head { flex: 1 1 280px; display: flex; flex-direction: column; gap: 16px; }
.about-title {
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.about-body { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.about-lead {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.32;
  letter-spacing: -0.015em;
}
.about-text { font-size: 18px; line-height: 1.6; color: var(--text-muted); max-width: 48ch; }

/* ---------- Contact ---------- */
.section-contact { position: relative; overflow: hidden; }

.contact-glow {
  position: absolute;
  right: -10%;
  top: 50%;
  width: 760px;
  height: 520px;
  transform: translateY(-50%);
  background: radial-gradient(closest-side, var(--accent), transparent);
  opacity: 0.08;
  filter: blur(40px);
  animation: glow 8s ease-in-out infinite;
  pointer-events: none;
}

.contact-inner {
  position: relative;
  padding-top: 96px;
  padding-bottom: 96px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 56px 64px;
}

.contact-copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.contact-title {
  font-size: clamp(40px, 5.6vw, 84px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.045em;
  max-width: 12ch;
}
.contact-text { font-size: 20px; line-height: 1.5; color: var(--text-muted); }

.terminal-contact { flex: 1 1 480px; min-width: 0; }
.contact-body { gap: 20px; }
.contact-cmd { font-size: 15px; }

.mail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  color: var(--text-white);
  text-decoration: none;
  font-size: clamp(17px, 1.7vw, 22px);
  font-weight: 500;
  overflow-wrap: anywhere;
  transition: border-color .2s ease, background-color .2s ease;
}
.mail-row:hover { border-color: var(--accent); background-color: #121418; }
.mail-arrow { color: var(--accent); transition: transform .2s ease; }
.mail-row:hover .mail-arrow { transform: translateX(4px); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg); border-top: 1px solid var(--line); }
.footer-inner {
  padding-top: 36px;
  padding-bottom: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}
.footer-brand { color: var(--text); letter-spacing: 0.18em; font-size: 13px; }

/* ---------- Animations ---------- */
@keyframes lineIn {
  0%   { opacity: 0; transform: translateY(6px); }
  2%   { opacity: 1; transform: none; }
  86%  { opacity: 1; }
  90%  { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes bar {
  0%, 8%    { width: 0; }
  45%, 86%  { width: 100%; }
  90%, 100% { width: 0; }
}
@keyframes caret {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes glow {
  0%, 100% { opacity: .35; }
  50%      { opacity: .7; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  :root { --gutter: 20px; }

  .nav { gap: 0; }
  .nav-link { display: none; }        /* keep only /contact on phones */

  .hero-inner { padding-top: 72px; padding-bottom: 72px; gap: 48px; }
  .hero-copy { gap: 24px; }
  .hero .terminal-body { min-height: 0; font-size: 13px; padding: 22px 18px; }
  .hero-glow { inset: -30px; }

  .section-what .container { padding-top: 72px; padding-bottom: 72px; }
  .service { min-height: 220px; }

  .about-inner { padding-top: 72px; padding-bottom: 72px; gap: 32px; }

  .contact-inner { padding-top: 72px; padding-bottom: 72px; gap: 40px; }
  .contact-body { padding: 22px 18px; }
  .contact-cmd { font-size: 13px; }
  .mail-row { padding: 0 16px; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ln { opacity: 1 !important; transform: none !important; }
  .progress-fill { width: 100% !important; }
}
