/* ==========================================================================
   1. DESIGN TOKENS (CSS custom properties)
   Keeping colors/sizes as variables means we only change them in ONE place
   if the brand color or spacing ever needs to change later.
   ========================================================================== */
:root {
  /* Colors */
  --bg: #0a0a0f;              /* near-black background */
  --bg-alt: #0d0d13;          /* very slightly different shade, used to separate sections */
  --surface: #14141c;         /* card / form backgrounds, a step lighter than bg */
  --border: rgba(255, 255, 255, 0.08);

  --text: #e8e8ed;            /* main text, off-white (pure white feels too harsh on dark bg) */
  --text-muted: #9aa0ac;      /* secondary text, softer contrast */

  --accent: #4da3ff;          /* electric blue accent */
  --accent-soft: rgba(77, 163, 255, 0.15);

  /* Type */
  --font-jp: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Yu Gothic", "Meiryo", system-ui, -apple-system, sans-serif;

  /* Layout */
  --container-width: 1080px;
  --radius: 14px;
}

/* ==========================================================================
   2. RESET / BASE
   A small reset so every browser starts from the same blank slate.
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth; /* smooth-scrolls to sections when nav links are clicked */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-jp);
  /* Japanese text needs more line-height than English to avoid feeling cramped */
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

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

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

ul,
dl {
  list-style: none;
}

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

/* ==========================================================================
   3. HEADER / NAV
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  color: var(--text);
}

.logo-small {
  font-size: 1.1rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--text);
}

.nav-cta {
  color: var(--accent) !important;
  border: 1px solid rgba(77, 163, 255, 0.4);
  padding: 8px 16px;
  border-radius: 999px;
}

.nav-cta:hover {
  background: var(--accent-soft);
}

/* Language switcher link (JA <-> EN), styled as a quiet pill so it doesn't
   compete with the "nav-cta" contact button for attention */
.lang-switch {
  color: var(--text-muted) !important;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.lang-switch:hover {
  color: var(--text) !important;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hamburger button: hidden on desktop, shown on mobile (see media query below) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ==========================================================================
   4. HERO
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 100px;
}

/* Decorative background: a faint grid + a soft blue glow behind the hero text.
   This is what gives the "subtle futuristic edge" without being loud. */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle at 20% 20%, var(--accent-soft), transparent 45%),
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 90%);
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 900;
  line-height: 1.5;
  margin-bottom: 24px;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 36px;
}

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */
.btn {
  display: inline-block;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #06111f;
  border: none;
  /* soft glow behind the button, echoes the "neon" brief without being gaudy */
  box-shadow: 0 0 24px rgba(77, 163, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(77, 163, 255, 0.5);
}

/* ==========================================================================
   6. SECTION LAYOUT (shared by Work / About / Contact)
   ========================================================================== */
.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-eyebrow {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 900;
  margin-bottom: 16px;
}

.section-lead {
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 48px;
}

/* ==========================================================================
   7. WORK / CASE STUDY CARDS
   ========================================================================== */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.case-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.case-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Gradient thumbnail used instead of a screenshot for demo case studies
   (projects without a real live site to photograph). --case-color-1 and
   --case-color-2 are set inline per-card so each project gets its own look. */
.case-image--generated {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--case-color-1), var(--case-color-2));
}

.case-image--generated span {
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.5px;
}

.case-body {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.case-client {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.case-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.case-details {
  margin-bottom: 24px;
}

.case-details > div {
  margin-bottom: 16px;
}

.case-details dt {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.case-details dd {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.case-link {
  margin-top: auto;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.case-link:hover {
  text-decoration: underline;
}

/* Placeholder cards for future case studies: dashed border makes it obvious
   at a glance that this slot is "not real content yet" */
.case-card--placeholder {
  border: 1px dashed var(--border);
  background: transparent;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.case-placeholder-inner {
  text-align: center;
  padding: 28px;
}

.case-placeholder-label {
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.case-placeholder-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ==========================================================================
   8. ABOUT
   ========================================================================== */
.about-inner {
  max-width: 700px;
}

.about-bio {
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 640px;
}

/* ==========================================================================
   9. CONTACT
   ========================================================================== */
.contact-inner {
  max-width: 560px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 8px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-row input,
.form-row textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-jp);
  font-size: 1rem;
  resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.contact-form .btn {
  align-self: flex-start;
  border: none;
}

/* Shown inline in the form if the fetch() submit fails (see js/script.js) */
.form-error {
  color: #ff8a8a;
  font-size: 0.9rem;
}

/* Shown in place of the form after a successful submit */
.form-success {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 8px;
}

.form-success-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-success-note {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.form-success .btn {
  border: none;
}

.contact-fallback {
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contact-fallback a {
  color: var(--accent);
}

.contact-fallback a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   11. RESPONSIVE (mobile-first breakpoint)
   Anything above 768px is "desktop" in this file; below that, we simplify
   the layout to a single column and swap the nav for a hamburger menu.
   ========================================================================== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 20px;
    display: none; /* toggled to "flex" by js/script.js when hamburger is tapped */
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-cta {
    margin-top: 12px;
    text-align: center;
    border-color: rgba(77, 163, 255, 0.4);
  }

  .lang-switch {
    margin-top: 12px;
    text-align: center;
  }

  .hero {
    padding: 80px 0 64px;
  }

  .section {
    padding: 64px 0;
  }

  .about-bio {
    max-width: none;
  }
}
