/* ==========================================================================
   Tugsbyte — Design tokens
   Instrument-panel dark theme. Amber signal accent on graphite.
   ========================================================================== */

:root {
  /* Color */
  --bg: #040e22;
  --bg-elevated: #050912;
  --bg-card: #01040b;
  --bg-card-hover: #061638;
  --border: #242a36;
  --border-soft: #1a1f29;
  --text: #eceef3;
  --text-muted: #9aa3b5;
  --text-faint: #5c6577;
  --accent: #e8a33d;
  --accent-hover: #f4bb63;
  --accent-soft: rgba(232, 163, 61, 0.12);
  --accent-line: rgba(232, 163, 61, 0.35);
  --mint: #6ee7b7;
  --red: #f2726b;

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* Layout */
  --maxw: 1200px;
  --radius: 10px;
  --radius-sm: 6px;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* faint grid texture on the base background */
body {
  background-image:
    linear-gradient(rgba(232, 163, 61, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 163, 61, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
}

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

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

button {
  font-family: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

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

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 1px var(--accent-line);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #16130a;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

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

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   Header / nav
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #050912;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 24px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a,
.nav-links button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover,
.nav-links button:hover {
  color: var(--text);
  background: var(--bg-card);
}

.nav-links .btn {
  margin-left: 8px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 168px 0 96px;
  position: relative;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-heading {
  font-size: clamp(30px, 4vw, 46px);
  margin: 18px 0 22px;
  color: var(--text);
}

.hero-heading em {
  font-style: normal;
  color: var(--accent);
}

.hero-copy {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 34px;
}

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

/* signature: signal readout bars */
.signal {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  margin-top: 28px;
}

.signal span {
  width: 3px;
  background: var(--accent);
  opacity: 0.55;
  border-radius: 2px;
  animation: pulse 1.6s ease-in-out infinite;
}

.signal span:nth-child(1) { height: 40%; animation-delay: 0s; }
.signal span:nth-child(2) { height: 90%; animation-delay: 0.12s; }
.signal span:nth-child(3) { height: 60%; animation-delay: 0.24s; }
.signal span:nth-child(4) { height: 100%; animation-delay: 0.36s; }
.signal span:nth-child(5) { height: 50%; animation-delay: 0.48s; }
.signal span:nth-child(6) { height: 75%; animation-delay: 0.6s; }
.signal span:nth-child(7) { height: 35%; animation-delay: 0.72s; }

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.85); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* framed hero image, instrument-panel corner ticks */
.hero-frame {
  position: relative;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.hero-frame::before,
.hero-frame::after,
.hero-frame .tick-tl,
.hero-frame .tick-br {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
}

.hero-frame::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.hero-frame::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.hero-frame img {
  border-radius: var(--radius-sm);
  width: 100%;
  height: auto;
  object-fit: cover;
}

.hero-frame-caption {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  margin-top: 12px;
  padding: 0 2px;
}

/* ==========================================================================
   Section shell
   ========================================================================== */

.section {
  padding: 88px 0;
  border-top: 1px solid var(--border-soft);
}

.section-head {
  max-width: 640px;
  margin: 0 auto 52px;
  text-align: center;
}

.section-title {
  font-size: clamp(24px, 3vw, 32px);
  margin: 16px 0 14px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 16px;
}

/* ==========================================================================
   Service cards (spec-sheet style — numbered, it's a real catalogue)
   ========================================================================== */

.grid-services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.spec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px 26px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  position: relative;
}

.spec-card:hover {
  border-color: var(--accent-line);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}

.spec-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.spec-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

.spec-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spec-icon svg {
  width: 26px;
  height: 26px;
}

.spec-title {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text);
}

.spec-details {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.65;
}

/* ==========================================================================
   Expertise / feature strip
   ========================================================================== */

.grid-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 8px;
}

.feature-item {
  text-align: left;
  border-left: 2px solid var(--border);
  padding-left: 22px;
  transition: border-color 0.2s ease;
}

.feature-item:hover {
  border-left-color: var(--accent);
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.feature-title {
  font-family: var(--font-mono);
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 10px;
}

.feature-details {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.65;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-elevated);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 60px;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border-soft);
}

.footer-cta-label {
  height: 3px;
  width: 40px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 18px;
}

.footer-cta h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.footer-cta p {
  color: var(--text-muted);
  max-width: 320px;
  margin-bottom: 20px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.footer-col li {
  margin-bottom: 12px;
}

.footer-col a,
.footer-col button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  text-align: left;
  transition: color 0.15s ease;
}

.footer-col a:hover,
.footer-col button:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

.footer-bottom-links a:hover {
  color: var(--accent);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ==========================================================================
   Contact page
   ========================================================================== */

.contact-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 130px 20px 60px;
}

.contact-card {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 38px 36px;
  position: relative;
}

.contact-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.contact-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.contact-close:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

.contact-close svg {
  width: 17px;
  height: 17px;
}

.contact-title {
  font-size: 22px;
}

.contact-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 26px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  transition: border-color 0.15s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.form-status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: var(--font-mono);
  display: none;
}

.form-status.show {
  display: block;
}

.form-status.ok {
  background: rgba(110, 231, 183, 0.1);
  color: var(--mint);
  border: 1px solid rgba(110, 231, 183, 0.3);
}

.form-status.err {
  background: rgba(242, 114, 107, 0.1);
  color: var(--red);
  border: 1px solid rgba(242, 114, 107, 0.3);
}

/* ==========================================================================
   Terms page
   ========================================================================== */

.terms-shell {
  min-height: 100vh;
  padding: 130px 20px 80px;
  display: flex;
  justify-content: center;
}

.terms-card {
  width: 100%;
  max-width: 820px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 44px 48px;
}

.terms-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.terms-title {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.terms-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 28px;
}

.terms-card h4 {
  font-family: var(--font-mono);
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 30px 0 10px;
}

.terms-card h4:first-of-type {
  margin-top: 0;
}

.terms-card p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.75;
  margin-bottom: 12px;
}

.terms-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms-card b {
  color: var(--text);
  font-weight: 600;
}

.terms-footnote {
  height: 3px;
  width: 40px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 32px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-frame {
    order: -1;
    max-width: 420px;
  }

  .grid-services {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-features {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
    gap: 6px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a,
  .nav-links button {
    width: 100%;
    text-align: left;
    padding: 16px 14px;
    font-size: 15px;
    border-bottom: 1px solid var(--border-soft);
    border-radius: 0;
  }

  .nav-links .btn {
    margin: 14px 0 0;
    justify-content: center;
  }

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

  .hero {
    padding-top: 148px;
  }

  .contact-card,
  .terms-card {
    padding: 30px 22px 30px;
  }
}
