/* Crafnia landing — v2 Dark
   Implements claude.ai/design "Crafnia Landing v2 Dark.dc.html" (synced 2026-08-13).
   หน้า privacy.html / terms.html ยังใช้ style.css (ธีม Organic เดิม) — ไฟล์นี้ใช้กับ index.html เท่านั้น */

:root {
  --bg: #0d0f0e;
  --bg-deep: #0b0d0c;
  --panel: #111413;
  --line: #1c2120;
  --line-2: #2b3231;
  --text: #ece7dd;
  --text-2: #c3c8c1;
  --muted: #a8aea7;
  --muted-2: #8f978f;
  --faint: #6b736c;
  --faint-2: #4e564f;
  --nav: #9aa39c;
  --ac: #6fd3e0;
  --ac-dim: #2c4a4f;
  --ac-bright: #a9e6ef;
  --on-ac: #08110f;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --ease-rise: cubic-bezier(.2, .75, .2, 1);
  --ease-reveal: cubic-bezier(.2, .7, .2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  overflow-x: clip;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.06;
  margin: 0;
}

a { color: var(--ac); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--ac-bright); }
a:focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; border-radius: 2px; }

::selection { background: var(--ac); color: var(--bg); }

[id] { scroll-margin-top: 76px; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes caret { 0%, 45% { opacity: 1; } 50%, 95% { opacity: 0; } 100% { opacity: 1; } }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes drift {
  0% { transform: translate3d(-4%, 0, 0) scale(1); }
  50% { transform: translate3d(6%, -3%, 0) scale(1.12); }
  100% { transform: translate3d(-4%, 0, 0) scale(1); }
}

/* ---- chrome ---- */

.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page { background: var(--bg); min-height: 100vh; position: relative; }

main { position: relative; z-index: 2; }

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding-left: clamp(18px, 4vw, 48px);
  padding-right: clamp(18px, 4vw, 48px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 15, 14, .86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px 26px;
  flex-wrap: wrap;
  min-height: 62px;
  padding-top: 13px;
  padding-bottom: 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.02em;
}
.brand:hover { color: var(--text); }
.brand svg { width: 24px; height: 24px; color: var(--ac); flex: none; display: block; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.site-nav a { color: var(--nav); }
.site-nav a:hover { color: var(--ac); }

.kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ac);
}

/* ---- hero ---- */

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }

.hero-glow {
  position: absolute;
  left: -10%;
  top: -40%;
  width: 70%;
  height: 150%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(111, 211, 224, .13), transparent 72%);
  animation: drift 26s ease-in-out infinite;
}

.hero-inner {
  position: relative;
  padding-top: clamp(52px, 8vw, 124px);
  padding-bottom: clamp(40px, 5vw, 64px);
}

.hero .kicker { animation: rise .7s var(--ease-rise) both; }

.hero h1 { margin: 22px 0 0; font-size: clamp(44px, 8.4vw, 124px); max-width: 15ch; }
.hero h1 span { display: block; animation: rise .8s var(--ease-rise) both; }
.hero h1 span:nth-child(1) { animation-delay: .06s; }
.hero h1 span:nth-child(2) { animation-delay: .14s; }
.hero h1 span:nth-child(3) {
  color: var(--ac);
  font-variation-settings: 'wdth' 82, 'wght' 800;
  animation-delay: .22s;
}

.hero-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .62fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  margin-top: clamp(30px, 4vw, 52px);
}

.hero-copy { animation: rise .8s var(--ease-rise) .3s both; }
.hero-lead { margin: 0; max-width: 56ch; color: var(--text-2); font-size: 17.5px; }
.hero-lead em { font-style: italic; color: var(--ac); }
.hero-sub { margin: 14px 0 0; max-width: 56ch; color: var(--muted-2); font-size: 16px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn-primary {
  padding: 13px 26px;
  border-radius: 2px;
  background: var(--ac);
  color: var(--on-ac);
  font-weight: 600;
  font-size: 15px;
  transition: filter .18s ease;
}
.btn-primary:hover { filter: brightness(1.12); color: var(--on-ac); }

.btn-ghost {
  padding: 13px 24px;
  border-radius: 2px;
  border: 1px solid var(--line-2);
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  transition: border-color .18s ease, color .18s ease;
}
.btn-ghost:hover { border-color: var(--ac); color: var(--ac); }

.hero-panel { animation: rise .8s var(--ease-rise) .38s both; }

.status-card {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 18px 20px;
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-2);
  display: grid;
  gap: 9px;
}
.status-card .row { display: flex; justify-content: space-between; gap: 14px; }
.status-card .row-rule { border-top: 1px solid var(--line); padding-top: 9px; }
.status-card .val { color: var(--text); }
.status-card .val-ac { color: var(--ac); }
.status-card .caret { color: var(--ac); animation: caret 1.15s steps(1) infinite; }

/* ---- marquee ---- */

.marquee {
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 11px 0;
  background: var(--bg-deep);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: slide 96s linear infinite;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--faint-2);
}
.marquee-track > span { display: flex; gap: 26px; padding-right: 26px; }
.marquee .sep { color: var(--ac-dim); }

/* ---- sections (shared) ---- */

.section-pad { padding-top: clamp(48px, 6vw, 88px); padding-bottom: clamp(48px, 6vw, 88px); }

.section-head h2 { margin: 14px 0 0; font-size: clamp(30px, 4vw, 52px); }
.section-lead { margin: 16px 0 0; max-width: 58ch; color: var(--muted-2); }

/* ---- apps ---- */

.app-list { margin-top: 40px; }

.app-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 190px) minmax(0, 1fr);
  gap: 8px clamp(18px, 3vw, 44px);
  align-items: start;
  padding: 26px clamp(10px, 2vw, 20px);
  border-top: 1px solid var(--line);
}
.app-list > :last-child { border-bottom: 1px solid var(--line); }

a.app-row {
  color: var(--text);
  transition:
    opacity .75s var(--ease-reveal),
    transform .75s var(--ease-reveal),
    background-color .2s ease,
    box-shadow .2s ease;
}
a.app-row:hover {
  background-color: var(--panel);
  box-shadow: inset 3px 0 0 var(--ac);
  color: var(--text);
}

.app-num { font-family: var(--font-mono); font-size: 13px; color: var(--faint-2); padding-top: 7px; }

.app-row h3 { font-size: clamp(23px, 2.4vw, 29px); }

.app-tags {
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tag { padding: 4px 9px; border: 1px solid var(--line-2); color: var(--muted-2); border-radius: 2px; }
.tag-open { border-color: var(--ac); color: var(--ac); }
.tag-early { color: var(--faint); }
.app-platform { color: var(--faint); }

.app-desc { margin: 0; color: var(--muted); font-size: 16.5px; max-width: 56ch; }
.app-link { margin: 12px 0 0; font-family: var(--font-mono); font-size: 13.5px; color: var(--ac); }

.client-note { margin: 26px 0 0; max-width: 64ch; color: var(--muted-2); font-size: 16px; }

/* ---- method ---- */

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

.method-grid {
  display: grid;
  grid-template-columns: minmax(0, .6fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
.method-grid h2 { margin: 14px 0 0; font-size: clamp(28px, 3.4vw, 44px); max-width: 14ch; }

.method-copy p { margin: 18px 0 0; color: var(--muted); font-size: 17px; max-width: 60ch; }
.method-copy p:first-child { margin-top: 0; color: var(--text-2); }

/* ---- workshop photos ---- */

.section-photos { border-bottom: 1px solid var(--line); }

.photo-grid {
  padding-top: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(28px, 4vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 14px;
}
.photo-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  filter: saturate(.85) contrast(1.05);
}
.photo-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-wide img { aspect-ratio: 16 / 9; }
.photo-close img { aspect-ratio: 4 / 3; }

/* ---- history ---- */

.history-list { margin-top: 38px; }

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 8px clamp(20px, 4vw, 56px);
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.history-row:last-child { border-bottom: 1px solid var(--line); }

.history-label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ac);
}
.history-body { margin: 0; color: var(--muted); font-size: 16.5px; max-width: 60ch; }

.history-next .history-label { color: var(--faint); }
.history-next .history-body { color: var(--muted-2); }

/* ---- who ---- */

.section-who { border-top: 1px solid var(--line); background: var(--bg-deep); }

.who-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .5fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.who-copy h2 { margin: 14px 0 0; font-size: clamp(28px, 3.4vw, 44px); }
.who-copy p { margin: 16px 0 0; color: var(--muted); font-size: 17px; max-width: 58ch; }
.who-copy p.first { margin-top: 22px; color: var(--text-2); }

.who-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.who-figure {
  margin: 0;
  align-self: start; /* กันโดน grid ยืดสูงจนวงกลมกลายเป็นวงรี */
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  filter: saturate(.85) contrast(1.05);
}
.who-figure img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }

/* ---- footer ---- */

.site-footer { border-top: 1px solid var(--line); position: relative; z-index: 2; }

.footer-inner {
  padding-top: 28px;
  padding-bottom: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--faint);
}
.footer-inner p { margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.footer-nav a { color: var(--muted-2); }
.footer-nav a:hover { color: var(--ac); }

/* ---- scroll reveal ---- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .75s var(--ease-reveal), transform .75s var(--ease-reveal);
}
.reveal.in { opacity: 1; transform: none; }

/* ---- responsive ---- */

@media (max-width: 900px) {
  .hero-cols { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero-panel { max-width: 440px; }
  .method-grid, .who-grid { grid-template-columns: minmax(0, 1fr); }
  .who-figure { max-width: 280px; }
}

@media (max-width: 760px) {
  .photo-grid { grid-template-columns: minmax(0, 1fr); }
  .app-row { grid-template-columns: 44px minmax(0, 1fr); }
  .app-main { grid-column: 2; }
}

@media (max-width: 600px) {
  .history-row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .kicker, .hero h1 span, .hero-copy, .hero-panel,
  .hero-glow, .marquee-track, .status-card .caret { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
