/* Runetail Studios — dark, silver-on-black, engraved serif. Mirrors the logo. */

:root {
  --bg: #060606;
  --bg-2: #0d0d0d;
  --panel: #111110;
  --line: rgba(232, 226, 214, 0.12);
  --line-strong: rgba(232, 226, 214, 0.28);
  --silver: #e4ded3;
  --silver-2: #bdb6aa;
  --muted: #8b857b;
  --dim: #5f5a53;
  --soon: #d9b46a;
  --live: #9fd4b0;
  --driftlink: #6fc8ff;
  --driftlink-2: #ff6fb5;
  --dalmoran: #c9a35c;

  --serif: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--silver-2);
  font: 300 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--silver); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 16px; }

:focus-visible { outline: 1px solid var(--silver); outline-offset: 3px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  transition: background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(6, 6, 6, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font: 500 15px var(--serif);
  letter-spacing: .32em; text-transform: uppercase; color: var(--silver);
}
.nav__brand img { width: 34px; height: auto; mix-blend-mode: lighten; }
.nav__links { display: flex; gap: 28px; margin-left: auto; }
.nav__links a {
  white-space: nowrap; text-decoration: none; font-size: 12px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--muted); transition: color .2s;
}
.nav__links a:hover { color: var(--silver); }

.lang { display: flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px; }
.lang button {
  background: none; border: 0; cursor: pointer;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; letter-spacing: .14em; color: var(--muted);
  transition: background .2s, color .2s;
}
.lang button[aria-pressed="true"] { background: var(--silver); color: var(--bg); }
.lang button:not([aria-pressed="true"]):hover { color: var(--silver); }

@media (max-width: 1000px) {
  .nav__links { gap: 18px; }
  .nav__links a { letter-spacing: .14em; }
  .nav__brand span { display: none; }
}
@media (max-width: 720px) {
  .nav { gap: 12px; }
  .nav__links { display: none; }
  .lang { margin-left: auto; }
  .nav__brand span { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 96px var(--gutter) 72px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 42%, rgba(220, 212, 196, 0.07), transparent 70%),
    var(--bg);
  overflow: hidden;
}
.hero__motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__inner { position: relative; text-align: center; max-width: 960px; }
.hero__logo {
  width: min(880px, 100%); height: auto; margin: 0 auto -2%;
  mix-blend-mode: lighten;
  /* fade the square image's edges into the page */
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 62%, transparent 100%);
          mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 62%, transparent 100%);
  animation: rise 1.6s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__lead {
  max-width: 34em; margin: 0 auto 32px;
  font-size: clamp(15px, 1.6vw, 18px); color: var(--silver-2);
  animation: rise 1.6s .25s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__cta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  animation: rise 1.6s .4s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__scroll {
  position: absolute; bottom: 24px; left: 50%; translate: -50% 0;
  width: 22px; height: 36px; border: 1px solid var(--line-strong); border-radius: 12px;
}
.hero__scroll span {
  position: absolute; left: 50%; top: 7px; width: 2px; height: 7px; translate: -50% 0;
  background: var(--silver-2); border-radius: 2px; animation: scrollcue 2s infinite;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes scrollcue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  .hero__logo, .hero__lead, .hero__cta, .hero__scroll span { animation: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 26px;
  font: 500 12px var(--sans); letter-spacing: .22em; text-transform: uppercase;
  text-decoration: none; border-radius: var(--radius);
  transition: background .25s, color .25s, border-color .25s, box-shadow .25s;
}
.btn--primary {
  background: linear-gradient(180deg, #f1ece3, #c9c2b6); color: #0b0b0b;
  box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset, 0 8px 30px -10px rgba(230, 222, 206, .45);
}
.btn--primary:hover { box-shadow: 0 0 0 1px rgba(255,255,255,.4) inset, 0 10px 40px -8px rgba(230, 222, 206, .6); }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--silver); }
.btn--ghost:hover { border-color: var(--silver-2); background: rgba(255,255,255,.03); }

/* ---------- Sections ---------- */
.section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(80px, 12vw, 150px) var(--gutter) 0;
}
.section--tight { padding-bottom: clamp(60px, 8vw, 100px); }
.section__head { text-align: center; margin-bottom: clamp(48px, 7vw, 88px); }
.section__lead { max-width: 36em; margin: 24px auto 0; color: var(--muted); }

.eyebrow {
  margin: 0 0 14px; font-size: 11px; font-weight: 500;
  letter-spacing: .5em; text-transform: uppercase; color: var(--muted);
}
.title {
  margin: 0; font: 400 clamp(28px, 4.4vw, 46px)/1.15 var(--serif);
  letter-spacing: .08em; text-transform: uppercase; color: var(--silver);
  text-shadow: 0 0 40px rgba(230, 222, 206, .15);
}
.rule {
  display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px;
}
.rule::before, .rule::after { content: ''; width: 72px; height: 1px; background: var(--line-strong); }
.rule span { width: 5px; height: 5px; rotate: 45deg; border: 1px solid var(--silver-2); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--silver-2); white-space: nowrap;
}
.tag--soon { color: var(--soon); border-color: rgba(217, 180, 106, .45); }
.tag--soon::before, .tag--live::before {
  content: ''; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.tag--live { color: var(--live); border-color: rgba(159, 212, 176, .4); }
.muted { color: var(--dim); font-size: 13px; }

/* ---------- Projects ---------- */
.project {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
  padding: clamp(28px, 4vw, 56px);
  margin-bottom: clamp(56px, 8vw, 96px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%), var(--bg-2);
  overflow: hidden;
}
.project::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at var(--glow-x, 20%) 0%, var(--glow), transparent 70%);
}
.project--driftlink { --glow: rgba(111, 200, 255, .10); --glow-x: 15%; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.project--dalmoran  { --glow: rgba(201, 163, 92, .12); --glow-x: 85%; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }

.project__body { position: relative; }
.project__body > p { margin: 0 0 18px; }
.project__title {
  margin: 18px 0 6px; font: 500 clamp(30px, 4vw, 44px)/1.1 var(--serif);
  letter-spacing: .06em; color: var(--silver);
}
.project--driftlink .project__title {
  background: linear-gradient(90deg, #e9f6ff, var(--driftlink) 55%, var(--driftlink-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.project__title--logo img { width: min(320px, 80%); height: auto; }
.project__tagline {
  font: 400 15px var(--serif) !important; letter-spacing: .14em; text-transform: uppercase;
  color: var(--silver) !important; margin-bottom: 22px !important;
}
.project__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.project--dalmoran .btn--primary {
  background: linear-gradient(180deg, #ecd7a4, #b8914d);
  box-shadow: 0 0 0 1px rgba(255, 236, 190, .3) inset, 0 8px 30px -10px rgba(201, 163, 92, .55);
}

.project__media { position: relative; }
.project__media--portrait { display: flex; justify-content: center; }

.phone {
  width: min(320px, 100%); aspect-ratio: 9 / 16;
  border-radius: 26px; padding: 8px;
  background: linear-gradient(160deg, #2a2a2a, #0b0b0b);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 30px 80px -20px rgba(111, 200, 255, .35), 0 0 120px -40px rgba(255, 111, 181, .4);
}
.phone video { width: 100%; height: 100%; object-fit: cover; border-radius: 19px; background: #000; }

.frame {
  border-radius: 4px; overflow: hidden;
  border: 1px solid rgba(201, 163, 92, .35);
  box-shadow: 0 30px 80px -30px rgba(201, 163, 92, .35);
}
.frame video { width: 100%; aspect-ratio: 16 / 9; background: #000; }

.facts { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line); }
.facts li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.facts span { color: var(--muted); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; padding-top: 2px; }
.facts strong { font-weight: 400; color: var(--silver); text-align: right; }

.note {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 4px 0 20px !important; padding: 8px 14px;
  border: 1px solid rgba(201, 163, 92, .4); border-radius: var(--radius);
  background: rgba(201, 163, 92, .07); color: #e6cf9c; font-size: 13.5px; font-weight: 400;
}
.note svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* features */
.features {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
}
.feature {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel);
}
.feature img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.feature h4 {
  margin: 16px 18px 6px; font: 500 14px/1.35 var(--serif); letter-spacing: .06em; color: var(--silver);
}
.feature p { margin: 0 18px 18px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }

/* galleries */
.gallery { grid-column: 1 / -1; }
.gallery__label {
  display: flex; align-items: center; gap: 14px; margin: 0 0 16px;
  font-size: 11px; letter-spacing: .4em; text-transform: uppercase; color: var(--muted);
}
.gallery__label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.gallery__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gallery__grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.shot {
  position: relative; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: zoom-in; background: #000;
}
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .8s cubic-bezier(.2, .7, .2, 1), opacity .4s; opacity: .85; }
.shot span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 9px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  font: 500 11px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--silver); text-align: left;
}
.shot:hover img { transform: scale(1.06); opacity: 1; }
.gallery__grid--5 .shot img { aspect-ratio: 4 / 3; }

@media (max-width: 920px) {
  .project, .project--driftlink, .project--dalmoran { grid-template-columns: minmax(0, 1fr); }
  .project--dalmoran .project__media { order: 0; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery__grid, .gallery__grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery__grid--5 .shot:first-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .project { padding: 20px 16px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .facts li { flex-direction: column; gap: 2px; }
  .facts strong { text-align: left; }
}

/* ---------- Technology ---------- */
.tools { display: grid; gap: 24px; }
.tool {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 4vw, 56px); align-items: center;
  padding: clamp(24px, 3.4vw, 44px);
  border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 50%), var(--bg-2);
  transition: border-color .3s;
}
.tool:hover { border-color: var(--line-strong); }
.tool--flip { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.tool--flip .tool__body { order: 2; }
.tool__body { display: flex; flex-direction: column; }
.tool__media { min-width: 0; }
.tool__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.tool__rune {
  position: relative; display: grid; place-items: center; width: 52px; height: 52px; flex: none;
  font: 22px var(--serif); color: var(--silver);
}
.tool__rune::before {
  content: ''; position: absolute; inset: 7px; rotate: 45deg;
  border: 1px solid var(--line-strong); border-radius: 3px;
}
.tool h3 { margin: 0; font: 500 28px var(--serif); letter-spacing: .08em; color: var(--silver); }
.tool__kind { margin: 4px 0 16px; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.tool__body > p:not(.tool__kind) { margin: 0 0 24px; }
.tool__links { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.tool__links a {
  text-decoration: none; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--silver);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.tool__links a:hover { border-bottom-color: var(--silver); }

/* code window */
.code {
  margin: 0; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden;
  background: #0a0a0a; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9);
}
.code figcaption {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: #121212;
}
.code figcaption span { width: 9px; height: 9px; border-radius: 50%; background: #2c2c2c; }
.code figcaption em { margin-left: 10px; font: normal 11.5px ui-monospace, 'SF Mono', Menlo, monospace; color: var(--muted); }
.code pre {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  font: 12.5px/1.65 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: #cfc9be;
}
.code .k { color: #c9a35c; }
.code .s { color: #9fd4b0; }
.code .t { color: #8fc7ff; }
.code .f { color: #e8e2d6; }

/* screenshot stack */
.stack { position: relative; padding-bottom: 16%; }
.stack .shot img { aspect-ratio: auto; opacity: 1; }
.stack__front { position: relative; z-index: 1; width: 86%; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .9); }
.stack__back { position: absolute; right: 0; bottom: 0; width: 58%; z-index: 2; box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .95); }
.shot--ui { width: 100%; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .9); }
.shot--ui img, .stack .shot img { transform: none !important; }
.shot--ui img { aspect-ratio: auto; opacity: 1; }

@media (max-width: 920px) {
  .tool, .tool--flip { grid-template-columns: minmax(0, 1fr); }
  .tool--flip .tool__body { order: 0; }
}

/* ---------- Open source list ---------- */
.oss { list-style: none; margin: 0 auto; padding: 0; max-width: 860px; border-top: 1px solid var(--line); }
.oss li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 90px; align-items: center; gap: 20px;
  padding: 20px 4px; border-bottom: 1px solid var(--line);
}
.oss strong { display: block; font: 500 17px var(--serif); letter-spacing: .08em; color: var(--silver); }
.oss li div span { font-size: 14px; color: var(--muted); }
.oss a {
  justify-self: end; text-decoration: none; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--silver);
}
.oss a:hover { text-decoration: underline; text-underline-offset: 4px; }
.oss .tag { justify-self: start; }
.oss .is-soon strong { color: var(--silver-2); }
.oss .muted { justify-self: end; }
@media (max-width: 560px) {
  .oss li { grid-template-columns: minmax(0, 1fr) auto; }
  .oss li div { grid-column: 1 / -1; }
  .oss a, .oss .muted { justify-self: end; }
}

/* ---------- Contact ---------- */
.contact {
  max-width: 760px; margin: 0 auto; text-align: center;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 64px);
  border: 1px solid var(--line); border-radius: 6px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(220, 212, 196, 0.07), transparent 70%),
    var(--bg-2);
}
.contact__lead { max-width: 32em; margin: 24px auto 32px; color: var(--muted); }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.contact__copy { cursor: pointer; background: none; text-transform: none; letter-spacing: .04em; font-size: 14px; min-width: 250px; }
.contact__copied { color: var(--live); letter-spacing: .2em; text-transform: uppercase; font-size: 12px; }

/* ---------- Footer ---------- */
.footer {
  margin-top: clamp(60px, 8vw, 100px);
  padding: 64px var(--gutter) 48px; text-align: center;
  border-top: 1px solid var(--line);
  background: radial-gradient(ellipse 50% 80% at 50% 0%, rgba(220, 212, 196, 0.05), transparent 70%);
}
.footer img { width: 56px; height: auto; margin: 0 auto 14px; mix-blend-mode: lighten; opacity: .9; }
.footer__brand { margin: 0; font: 500 18px var(--serif); letter-spacing: .36em; text-transform: uppercase; color: var(--silver); }
.footer__tag { margin: 6px 0 24px; font-size: 10px; letter-spacing: .6em; text-transform: uppercase; color: var(--dim); }
.footer__links { display: flex; justify-content: center; gap: 28px; margin-bottom: 24px; }
.footer__links a { text-decoration: none; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.footer__links a:hover { color: var(--silver); }
.footer__copy { margin: 0; font-size: 12px; color: var(--dim); }

/* ---------- Lightbox ---------- */
.lightbox {
  max-width: min(1400px, 94vw); max-height: 92vh; padding: 0; border: 1px solid var(--line-strong);
  background: #000; border-radius: 4px; overflow: visible;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .86); backdrop-filter: blur(4px); }
.lightbox img { max-width: 100%; max-height: 90vh; width: auto; height: auto; }
.lightbox__close {
  position: absolute; top: -44px; right: 0; width: 36px; height: 36px;
  background: none; border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--silver); font-size: 20px; line-height: 1; cursor: pointer;
}
