/* ============================================================================
   Martox — martox.xyz  ·  retro anime, monochrome (black / white / grey)
   ============================================================================ */

:root {
  /* The scene reads --road to know how much of the viewport belongs to the
     asphalt, and writes the resolved pixel value back. Never let the panel
     cover the road. */
  --road: clamp(140px, 26vh, 320px);

  --ink: #0a0a0a;
  --ink-soft: #3d3d3d;
  --ink-faint: #6f6f6f;
  --paper: #ffffff;
  --panel: rgba(255, 255, 255, 0.82);
  --line: 2px solid var(--ink);

  --font-display: 'Russo One', 'Segoe UI', system-ui, sans-serif;
  --font-ui: 'Manrope', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-jp: 'Yu Gothic', 'Meiryo', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'MS PGothic', sans-serif;

  --gutter: clamp(14px, 2.4vw, 34px);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;   /* never let a wide child create a sideways scroll */
}

body {
  min-height: 100dvh;
  background: #efefef;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------- background */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.fx {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* film grain */
.fx-grain::after {
  content: '';
  position: absolute;
  inset: -80px;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.16;
  animation: grain 0.9s steps(3) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-24px, 16px); }
  66%  { transform: translate(18px, -22px); }
  100% { transform: translate(0, 0); }
}

/* CRT scan lines */
.fx-scan {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.05) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: multiply;
}

/* print vignette */
.fx-vignette {
  background:
    radial-gradient(125% 105% at 50% 42%, transparent 52%, rgba(10, 10, 10, 0.2) 100%);
}

/* ------------------------------------------------------------------- layout */
.ui {
  position: relative;
  z-index: 3;
  height: 100vh;
  height: 100dvh;         /* fixed height: the panel scrolls, the page never does */
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 20px);
  padding: var(--gutter);
  padding-bottom: calc(var(--road) + 12px);
}

.topbar, .footer { flex: none; }

/* Text that floats directly on the artwork gets a white anime-subtitle halo. */
.halo-lg {
  text-shadow:
    3px 0 0 #fff, -3px 0 0 #fff, 0 3px 0 #fff, 0 -3px 0 #fff,
    3px 3px 0 #fff, -3px -3px 0 #fff, 3px -3px 0 #fff, -3px 3px 0 #fff,
    0 0 34px rgba(255, 255, 255, 0.95);
}
.halo-sm {
  text-shadow:
    1.5px 0 0 #fff, -1.5px 0 0 #fff, 0 1.5px 0 #fff, 0 -1.5px 0 #fff,
    1.5px 1.5px 0 #fff, -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff,
    0 0 16px rgba(255, 255, 255, 0.95);
}

/* ------------------------------------------------------------------ top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: none;
  border: 2px solid #fff;   /* white edge keeps it readable over dark foliage */
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.02em;
  box-shadow: 3px 3px 0 rgba(10, 10, 10, 0.22);
}

.brand-text { display: grid; }
.brand-name {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.5vw, 19px);
  letter-spacing: 0.08em;
  line-height: 1.1;
}
.brand-sub {
  font-family: var(--font-jp);
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.clock {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.4vw, 20px);
  letter-spacing: 0.08em;
  text-align: right;
  line-height: 1.15;
  white-space: nowrap;
}
.clock small {
  display: block;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* --------------------------------------------------------------- main panel */
.main {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(14px, 2vw, 28px);
  flex: 1 1 auto;
  align-content: center;
  align-content: safe center;
  min-height: 0;          /* shrinks instead of pushing the page taller */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  padding-right: 4px;
}

.hero { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.kicker {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-jp);
  font-size: 11px;
  letter-spacing: 0.34em;
  padding: 5px 12px 5px 14px;
  margin-bottom: clamp(10px, 1.6vh, 18px);
}

.title {
  font-family: var(--font-display);
  font-size: clamp(42px, 8.6vw, 110px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  text-shadow:
    3px 0 0 #fff, -3px 0 0 #fff, 0 3px 0 #fff, 0 -3px 0 #fff,
    3px 3px 0 #fff, -3px -3px 0 #fff, 3px -3px 0 #fff, -3px 3px 0 #fff,
    7px 9px 0 rgba(10, 10, 10, 0.16), 0 0 40px rgba(255, 255, 255, 0.95);
}
.title .thin { -webkit-text-stroke: 2px var(--ink); color: transparent; }

.tagline {
  margin-top: clamp(12px, 1.8vh, 20px);
  max-width: 44ch;
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 500;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(14px, 2vh, 22px);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 11px 18px;
  box-shadow: 4px 4px 0 rgba(10, 10, 10, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn:hover, .btn:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 rgba(10, 10, 10, 0.32);
}
.btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 rgba(10, 10, 10, 0.3); }

.facts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: clamp(14px, 2vh, 22px);
  padding: 9px 14px;
  border: 1px solid rgba(10, 10, 10, 0.35);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  list-style: none;
}
.facts li {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.facts b { color: var(--ink); }

/* ------------------------------------------------------------------ service */
.services {
  border: var(--line);
  background: var(--panel);
  backdrop-filter: blur(7px) saturate(120%);
  -webkit-backdrop-filter: blur(7px) saturate(120%);
  box-shadow: 8px 8px 0 rgba(10, 10, 10, 0.9);
  animation: rise 0.7s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.services-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: var(--line);
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.services-head span:last-child {
  font-family: var(--font-jp);
  letter-spacing: 0.2em;
  opacity: 0.75;
}

.menu { list-style: none; }

.menu li + li { border-top: 1px solid rgba(10, 10, 10, 0.16); }

.menu a {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(10px, 1.4vw, 18px);
  padding: clamp(11px, 1.5vh, 16px) clamp(12px, 1.6vw, 20px);
  color: inherit;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, padding 0.16s ease;
}

.menu a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: -1;
}
.menu a:hover::before,
.menu a:focus-visible::before { transform: scaleX(1); }
.menu a:hover, .menu a:focus-visible { color: var(--paper); }

.menu .num {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.3vw, 17px);
  letter-spacing: 0.04em;
  opacity: 0.6;
}

.menu .label {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.menu .name {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.55vw, 21px);
  letter-spacing: 0.04em;
  line-height: 1.15;
}
.menu .desc {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu a:hover .desc, .menu a:focus-visible .desc { color: rgba(255, 255, 255, 0.72); }

.menu .go {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.menu .arrow {
  font-size: 17px;
  line-height: 1;
  transition: transform 0.2s ease;
}
.menu a:hover .arrow, .menu a:focus-visible .arrow { transform: translateX(5px); }

/* live status dot, probed from each service's favicon */
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex: none;
  background: transparent;
}
.dot.is-online { background: currentColor; }
.dot.is-offline { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.dot.is-checking { animation: blink 1.1s ease-in-out infinite; }
.dot.is-offline { opacity: 0.5; }

@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---------------------------------------------------------------- ticker bar */
.ticker {
  margin-top: 12px;
  border: var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  display: flex;
  align-items: center;
  animation: rise 0.7s 0.14s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.ticker-tag {
  flex: none;
  background: var(--ink);
  color: var(--paper);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 7px 10px;
}
/* Seamless marquee: the line holds the text twice and slides exactly one copy
   (-50%), so there is always something in view and the loop never jumps.
   (The old version used padding-left:100% + translateX(-100%), which left the
   bar empty for most of the cycle.) */
.ticker-track { flex: 1 1 auto; min-width: 0; overflow: hidden; contain: paint; }
.ticker-line {
  display: flex;
  width: max-content;
  --ticker-dur: 24s;      /* fast enough to read as motion at a glance */
  animation: marquee var(--ticker-dur) linear infinite;
}
.ticker-line > span {
  flex: none;
  white-space: nowrap;
  padding-right: 3.5rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ------------------------------------------------------------------- footer */
.footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.footer .hint {
  text-align: right;
  color: var(--ink-soft);
}
.footer kbd {
  font-family: var(--font-ui);
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
}

/* ------------------------------------------------------------------- motion */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: var(--gutter);
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  font-weight: 700;
}

/* ------------------------------------------------------------------ screens */
/* Phone / tablet: a normal scrolling page. The scene stays fixed behind
   everything, the services are simply stacked and nothing scrolls in a box. */
@media (max-width: 1000px) {
  .ui {
    height: auto;
    min-height: 100dvh;
  }
  .main {
    flex: none;
    min-height: auto;
    overflow: visible;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }
  .title { font-size: clamp(38px, 12vw, 74px); }
  .tagline { max-width: none; }
  .services { box-shadow: 6px 6px 0 rgba(10, 10, 10, 0.9); }
}

/* No tap-to-drift hint where there is no drift control (phones, tablets, touch) */
html[data-drift='off'] .footer .hint { display: none; }

@media (max-width: 640px) {
  :root { --road: clamp(120px, 22vh, 220px); }
  .ui { padding-bottom: calc(var(--road) + 8px); }
  .brand-mark { width: 38px; height: 38px; font-size: 16px; }
  /* the date line may wrap instead of pushing past the right edge (320px phones) */
  .clock { white-space: normal; }
  .clock small { letter-spacing: 0.12em; }
  .menu .go .go-label { display: none; }
  .footer { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer .hint { text-align: left; }
  .menu .desc { white-space: normal; }
}

/* keep everything above the asphalt on shorter laptop screens */
@media (min-width: 1001px) and (max-height: 900px) {
  .title { font-size: clamp(38px, 6.6vw, 84px); }
  .menu a { padding: 10px 16px; }
  .tagline { margin-top: 10px; }
  .hero-actions { margin-top: 12px; }
  .facts { margin-top: 12px; padding-top: 10px; }
}

@media (max-height: 620px) and (min-width: 641px) {
  .title { font-size: clamp(34px, 6vw, 62px); }
  .menu a { padding: 9px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .fx-grain::after { display: none; }

  /* Two animations carry meaning instead of decoration, so they keep running
     (a frozen marquee looks broken, and a frozen “checking” dot reads as
     online). Everything else — entry rises, hovers, transitions — stays
     instant. Specificity beats the * rule above. */
  .ticker-line {
    animation-duration: var(--ticker-dur) !important;
    animation-iteration-count: infinite !important;
  }
  .dot.is-checking {
    animation-duration: 1.1s !important;
    animation-iteration-count: infinite !important;
  }
}
