:root {
  --teal: #0F7A6B;
  --mint: #8fd4c7;
  --ink: #13201c;
  --muted: #5c6a66;
  --border: #ddcca3;
  --bg: #f3e8d4;
  --surface: #ece0c3;
  --sidebar-bg: #0e1412;
  --materia: #FF5C00;
  --webido: #2ab800;
  --font-heading: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
  --max-width: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-left: 88px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 80px);
}

.container-narrow {
  max-width: 640px;
  text-align: center;
}

/* Sidebar */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 88px;
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0;
  z-index: 30;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo img {
  width: 24px;
  height: auto;
  display: block;
}

.sidebar-logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.75);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 36px;
  align-items: center;
}

.sidebar-nav a {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #fff;
}

.sidebar-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-dot span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mint);
}

/* Hero */

@keyframes mark-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
@keyframes mark-breathe {
  0%, 100% { opacity: 0.07; }
  50% { opacity: 0.13; }
}
@keyframes ticker-up {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
@keyframes ticker-down {
  from { transform: translateY(-50%); }
  to { transform: translateY(0); }
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  padding: 120px 24px 80px;
}

.mark-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  max-width: 480px;
  transform: translate(-50%, -50%);
  animation: mark-breathe 6s ease-in-out infinite;
  pointer-events: none;
}

.mark-bg img {
  width: 100%;
  height: auto;
  display: block;
  animation: mark-float 8s ease-in-out infinite;
}

.bg-word-mask {
  display: none;
}

.hero-text {
  position: relative;
  z-index: 2;
  max-width: 600px;
  text-align: left;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(5.2rem, 18vw, 11rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  font-weight: 700;
}
.hero h1 .brand { color: var(--teal); }
.hero h1 .suffix {
  display: inline-block;
  font-size: clamp(1.3rem, 3.5vw, 2.6rem);
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: baseline;
  margin-left: 0.08em;
}
.hero h1 .sub {
  display: block;
  font-size: clamp(1.1rem, 3vw, 2.1rem);
  font-weight: 500;
  color: var(--muted);
  margin-top: 10px;
  letter-spacing: 0;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 480px;
  margin: 0 0 32px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  padding: 15px 26px;
  border-radius: 8px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}
.btn:hover,
.btn:focus-visible {
  background: var(--teal);
}

.link {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}
.link:hover,
.link:focus-visible {
  color: var(--ink);
}

/* Sections */

.section {
  padding: 90px 0;
}

.section-contact {
  background: var(--surface);
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 12px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.section-lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 460px;
  margin: 0 auto 32px;
}

/* Projects */

.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 16px;
}

.project-card {
  position: relative;
  overflow: hidden;
  display: block;
  border-radius: 0;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 1px 2px rgba(18, 36, 32, 0.08);
}
.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(18, 36, 32, 0.18);
}

.project-card img {
  width: 100%;
  height: auto;
  display: block;
}

/* Footer */

.footer {
  background: var(--sidebar-bg);
  color: rgba(255, 255, 255, 0.6);
  padding: 72px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.footer-brand img { width: 18px; height: auto; }
.footer-brand span {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}

.footer-about p {
  max-width: 340px;
  font-size: 0.9rem;
  margin: 0 0 8px;
}
.footer-about p.muted { color: rgba(255, 255, 255, 0.4); }

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 4px;
}
.footer-col a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--mint); }

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 32px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: left;
  }
}

/* Large screens: shift hero composition left, show background words */

@media (min-width: 1100px) {
  .hero {
    padding-right: 320px;
  }
  .mark-bg {
    width: 42%;
    max-width: 560px;
  }
  .bg-word-mask {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    z-index: 1;
  }
  .bg-word-mask.materia { right: 7%; }
  .bg-word-mask.webido { right: 17%; }

  .bg-word-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    animation: ticker-up linear infinite;
  }
  .bg-word-mask.materia .bg-word-track { animation-duration: 48s; }
  .bg-word-mask.webido .bg-word-track { animation-name: ticker-down; animation-duration: 56s; }

  .bg-word {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 160px;
    letter-spacing: 0.04em;
    writing-mode: vertical-rl;
    text-transform: uppercase;
    white-space: nowrap;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 1px currentColor;
    color: transparent;
  }
  .bg-word-mask.materia .bg-word {
    color: var(--materia);
    opacity: 0.45;
  }
  .bg-word-mask.webido .bg-word {
    color: var(--webido);
    opacity: 0.45;
  }
}

/* Mobile */

@media (max-width: 640px) {
  body {
    padding-left: 64px;
  }
  .sidebar {
    width: 64px;
  }
  .hero {
    padding: 100px 20px 64px;
  }
  .projects {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
