/* ============================================================
   shirai.dev — Triangle Tech LLC
   Dark, typography-driven one-page site. No frameworks.
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #07080b;
  --bg-2: #0c0e13;
  --panel: rgba(255, 255, 255, 0.03);
  --panel-hover: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9ebf1;
  --muted: #9aa3b4;
  --accent: #6ee7ff;
  --accent-2: #a78bfa;
  --grad: linear-gradient(120deg, #6ee7ff 0%, #a78bfa 100%);
  --font-jp: "Noto Sans JP", "Hiragino Sans", sans-serif;
  --font-en: "Space Grotesk", "Noto Sans JP", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --nav-h: 64px;
  --maxw: 1080px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(110, 231, 255, 0.28); color: #fff; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
.mono { font-family: var(--font-mono); }
.pc { display: inline; }
.sp { display: none; }

/* ---------- background decoration ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.16; }
.bg-glow-1 { width: 560px; height: 560px; top: -180px; right: -120px; background: #6ee7ff; }
.bg-glow-2 { width: 480px; height: 480px; top: 320px; left: -200px; background: #a78bfa; opacity: 0.12; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 clamp(20px, 4vw, 40px);
  background: rgba(7, 8, 11, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-en); font-weight: 700; font-size: 17px; letter-spacing: 0.01em;
}
.nav-logo em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark { display: block; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a {
  font-family: var(--font-en); font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  font-size: 13px; font-weight: 700;
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid rgba(110, 231, 255, 0.45);
  color: var(--accent);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-cta:hover { background: rgba(110, 231, 255, 0.12); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 28px; border-radius: 12px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn-primary {
  background: var(--grad); color: #0a0c12;
  box-shadow: 0 8px 28px rgba(110, 231, 255, 0.22);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(110, 231, 255, 0.3); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: var(--panel); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.25); background: var(--panel-hover); }
.btn-lg { padding: 16px 34px; font-size: 16px; }

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 64px) clamp(20px, 4vw, 40px) 40px;
}
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em;
  color: var(--accent); margin-bottom: 20px;
}
.hero-title {
  font-family: var(--font-en);
  font-weight: 900;
  font-size: clamp(28px, 6vw, 64px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}
.hero-title .gr {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { color: var(--muted); font-size: clamp(14px, 1.8vw, 16px); }
.hero-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.hero-links { display: flex; flex-wrap: wrap; flex-shrink: 0; gap: 4px 24px; }
.hero-work-link { color: var(--accent); font-size: 13px; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; gap: 18px; }

/* ---------- sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px clamp(20px, 4vw, 40px);
}
.section-head {
  display: flex; align-items: baseline; gap: 18px;
  margin-bottom: 28px;
}
.section-index {
  font-size: 13px; color: var(--accent); letter-spacing: 0.18em;
}
.section-head h2 {
  font-family: var(--font-en); font-weight: 700;
  font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
}
.section-jp { font-family: var(--font-jp); font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0.14em; }

/* ---------- services cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card {
  position: relative;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel);
  padding: 28px 26px 26px;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.card:hover { border-color: rgba(110, 231, 255, 0.35); background: var(--panel-hover); transform: translateY(-3px); }
.card-index { position: absolute; top: 24px; right: 24px; font-size: 11.5px; color: rgba(255, 255, 255, 0.28); letter-spacing: 0.16em; }
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 14.5px; }

/* ---------- works ---------- */
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.work {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.work:hover { border-color: rgba(167, 139, 250, 0.4); transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.work-body { display: flex; flex-direction: column; gap: 10px; padding: clamp(24px, 3vw, 34px); flex: 1; }
.work-kind { font-size: 10.5px; letter-spacing: 0.2em; color: var(--accent); }
.work h3, .work h4 { font-family: var(--font-en); font-size: clamp(25px, 3vw, 32px); font-weight: 700; letter-spacing: -0.025em; }
.work p { color: var(--muted); font-size: 14px; line-height: 1.85; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
  font-size: 11px; letter-spacing: 0.04em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px;
}
.work-link { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-size: 13px; color: var(--accent); margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); transition: color 0.2s; }
.work-link:hover { color: var(--accent); }

/* ---------- company ---------- */
.company-table {
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
}
.company-table > div {
  display: grid; grid-template-columns: 180px 1fr;
  border-bottom: 1px solid var(--line);
}
.company-table > div:last-child { border-bottom: none; }
.company-table dt {
  padding: 18px 24px; font-size: 13.5px; color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}
.company-table dd { padding: 18px 24px; font-size: 14.5px; }
.company-table dd a { color: var(--accent); }
.company-table dd a:hover { text-decoration: underline; }

/* ---------- contact ---------- */
.contact { padding: 48px clamp(20px, 4vw, 40px) 64px; }
.contact-inner {
  max-width: var(--maxw); margin: 0 auto;
  text-align: center;
  border: 1px solid var(--line); border-radius: 24px;
  padding: clamp(48px, 8vh, 84px) clamp(22px, 5vw, 60px);
  background:
    radial-gradient(ellipse 70% 90% at 50% -10%, rgba(110, 231, 255, 0.1), transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 110%, rgba(167, 139, 250, 0.09), transparent 60%),
    var(--bg-2);
}
.contact-eyebrow { font-size: 12px; letter-spacing: 0.26em; color: var(--accent); margin-bottom: 18px; }
.contact-title { font-size: clamp(24px, 3.8vw, 34px); font-weight: 900; line-height: 1.4; margin-bottom: 14px; }
.contact-lead { color: var(--muted); font-size: 15px; margin-bottom: 36px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 26px clamp(20px, 4vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.footer-logo { font-size: 13px; letter-spacing: 0.1em; }
.footer-copy { font-size: 12px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .pc { display: none; }
  .sp { display: inline; }
  .nav-links { gap: 0; }
  .nav-links a:not(:first-child) { display: none; }
  .nav-cta { margin-left: 0; padding: 8px 12px; font-size: 12px; }
  .nav-logo { font-size: 15px; gap: 6px; }
  .nav { gap: 12px; }
  .cards, .works { grid-template-columns: 1fr; }
  .hero { padding-top: calc(var(--nav-h) + 44px); padding-bottom: 28px; }
  .hero-intro { align-items: flex-start; flex-direction: column; gap: 16px; }
  .company-table > div { grid-template-columns: 1fr; }
  .company-table dt { padding: 12px 20px 2px; background: none; }
  .company-table dd { padding: 2px 20px 14px; }
  .contact-actions .btn { width: 100%; }
  .card-index { position: static; display: block; margin-bottom: 8px; }
}

/* Keep the work in view and the supporting information quieter. */
.section-works { padding-top: 16px; }
.work-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.work-number { color: var(--muted); font-size: 13px; }
.works-featured .work:nth-child(1) { background: linear-gradient(135deg, rgba(110, 231, 255, 0.09), rgba(255, 255, 255, 0.02)); }
.works-featured .work:nth-child(2) { background: linear-gradient(135deg, rgba(167, 139, 250, 0.09), rgba(255, 255, 255, 0.02)); }
.work .work-caption { color: var(--text); font-size: 15px; flex: 0; }
.tags { margin-top: 12px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 20px; padding: 8px 16px; background: var(--text); color: var(--bg); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Current products lead; earlier work remains available below. */
.works-featured .work:nth-child(3) { background: linear-gradient(135deg, rgba(167, 139, 250, 0.09), rgba(255, 255, 255, 0.02)); }
.works-featured .work:nth-child(4) { background: linear-gradient(135deg, rgba(110, 231, 255, 0.09), rgba(255, 255, 255, 0.02)); }
.other-works { margin-top: 64px; }
.other-works-title { font-size: 18px; font-weight: 500; color: var(--muted); margin-bottom: 24px; }
.works-archive { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.works-archive .work-body { padding: 24px; }
.works-archive h4 { font-size: 22px; }
@media (max-width: 900px) {
  .works-archive { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .works-archive { grid-template-columns: 1fr; }
}
