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

:root {
  --bg:           #111111;
  --surface:      #1c1c1c;
  --border:       #2a2a2a;
  --border-hover: #3a3a3a;
  --text:         #f0f0f0;
  --muted:        #888888;
  --subtle:       #555555;
  --accent:       #c89838;
  --accent2:      #c4847a;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* overflow-x on wrapper, not body: position:fixed breaks in Safari otherwise */
#page-wrap { overflow-x: hidden; }

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

/* Nav */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-logo { display: flex; align-items: center; text-decoration: none; }

.nav-logo img { width: 36px; height: 36px; object-fit: contain; }

.nav-links { display: flex; align-items: center; gap: 1.5rem; }

.nav-icon {
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.18s;
}

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

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 5rem;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 15% 20%, rgba(200, 152, 56, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 55% at 85% 80%, rgba(196, 132, 122, 0.07) 0%, transparent 60%);
  pointer-events: none;
}

.hero-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 32px rgba(200, 152, 56, 0.28));
}

.hero-jp {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero h1 .accent {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), var(--accent2), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  max-width: 500px;
  line-height: 1.75;
  margin-bottom: 3rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: opacity 0.18s, transform 0.18s;
}

.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s, transform 0.18s;
}

.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); transform: translateY(-1px); }

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--subtle);
  animation: bounce 2s ease-in-out infinite;
}

/* About */
.about-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  text-align: center;
}

.about-text {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--muted);
  line-height: 1.85;
}

.about-text strong { color: var(--text); font-weight: 500; }

/* Sections */
.section-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}

.section-line { flex: 1; height: 1px; background: var(--border); }

/* Featured card */
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
  transition: border-color 0.3s;
}

.feature-card:hover {
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(120deg, var(--accent), var(--accent2)) border-box;
}

.feature-info {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7aba86;
  background: rgba(122, 186, 134, 0.08);
  border: 1px solid rgba(122, 186, 134, 0.18);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1.5rem;
  width: fit-content;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7aba86;
  animation: pulse 2s ease-in-out infinite;
}

.feature-info h3 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.feature-info p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 340px;
}

.feature-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding-bottom: 0.15rem;
  width: fit-content;
  transition: border-color 0.18s, gap 0.18s;
}

.feature-link:hover { border-color: var(--accent); gap: 0.6rem; }

.feature-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  position: relative;
}

.phone-mockup {
  width: 160px;
  height: 290px;
  background: var(--surface);
  border-radius: 28px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
  position: relative;
  transform: rotate(-3deg);
  transition: transform 0.3s;
}

.feature-card:hover .phone-mockup { transform: rotate(0deg) scale(1.02); }

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
}

.float-chip {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.4rem 0.65rem;
  font-size: 1.1rem;
  animation: chipFloat 3s ease-in-out infinite;
}

.float-chip:nth-child(1) { top: 15%;    right: 12%; animation-delay: 0s; }
.float-chip:nth-child(2) { bottom: 22%; left: 10%;  animation-delay: 0.8s; }
.float-chip:nth-child(3) { top: 45%;    left: 8%;   animation-delay: 1.5s; font-size: 0.9rem; }

/* Project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.project-grid li { display: contents; }

.project-card {
  background: var(--surface);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s;
}

.card-icon { font-size: 1.8rem; line-height: 1; }

.project-card h3 { font-size: 1rem; font-weight: 600; color: var(--text); }

.project-card p { font-size: 0.85rem; color: var(--muted); line-height: 1.65; flex: 1; }

.card-footer { display: flex; align-items: center; }

.badge {
  font-size: 0.68rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-weight: 500;
  border: 1px solid transparent;
}

.badge-green {
  color: #7aba86;
  background: rgba(122, 186, 134, 0.08);
  border-color: rgba(122, 186, 134, 0.18);
}

.badge-yellow {
  color: var(--accent);
  background: rgba(200, 152, 56, 0.08);
  border-color: rgba(200, 152, 56, 0.2);
}

.card-arrow {
  color: var(--subtle);
  transition: color 0.18s, transform 0.18s;
  flex-shrink: 0;
  margin-left: auto;
}

.project-card:hover                       { background: var(--border); }
.project-card:hover .card-arrow           { color: var(--muted); transform: translate(3px, -3px); }

.project-card--wide { grid-column: 1 / -1; }

/* Contact */
.contact-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
  text-align: center;
}

.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3rem 2.5rem;
}

.contact-box h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.contact-box p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 2rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
}

.site-footer p { font-size: 0.8rem; color: var(--muted); }

.site-footer a { color: var(--muted); text-decoration: none; transition: color 0.18s; }

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

/* Animations */
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(5px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-logo    { animation: fadeUp 0.6s ease both 0.10s; }
.hero-jp      { animation: fadeUp 0.6s ease both 0.20s; }
.hero h1      { animation: fadeUp 0.6s ease both 0.30s; }
.hero-sub     { animation: fadeUp 0.6s ease both 0.42s; }
.hero-actions { animation: fadeUp 0.6s ease both 0.54s; }
.scroll-hint  { animation: fadeUp 0.6s ease both 0.64s, bounce 2s ease-in-out 1.2s infinite; }

.reveal         { opacity: 0; transform: translateY(20px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.05s; }
.reveal-delay-2 { transition-delay: 0.12s; }

/* Responsive */
@media (max-width: 768px) {
  .feature-card  { min-height: unset; }
  .section-inner { padding-bottom: 4rem; }
}

@media (max-width: 640px) {
  .site-nav  { padding: 0.875rem 1.25rem; }
  .nav-links { gap: 1rem; }

  .hero      { padding: 5.5rem 1.25rem 4rem; min-height: 100svh; }
  .hero-logo { width: 96px; height: 96px; }

  .feature-card    { grid-template-columns: 1fr; }
  .feature-info    { padding: 1.75rem; order: 1; }
  .feature-info h3 { font-size: 1.8rem; }
  .feature-info p  { max-width: none; }
  .feature-visual  { order: 2; min-height: 260px; padding: 1.5rem; }
  .phone-mockup    { width: 120px; height: 220px; font-size: 3.2rem; }

  .section-inner { padding: 0 1.25rem 3rem; }
  .project-grid  { grid-template-columns: 1fr; }

  .contact-box  { padding: 2rem 1.5rem; }
  .contact-wrap { padding-bottom: 4rem; }
}

@media (max-width: 400px) {
  .hero-actions            { flex-direction: column; align-items: stretch; }
  .btn-primary, .btn-ghost { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
