/* =========================================================
   qixqwq.link - Anti-Polish / Raw Aesthetic
   Paper white, pencil grey, marker black, kraft brown.
   Imperfect, hand-made and comfortable with it.
   ========================================================= */

:root {
  /* palette (Anti-Polish Raw Aesthetic) */
  --paper:      #FAF7F0;   /* warm paper white  */
  --paper-2:    #F3EDE1;   /* notes / cards     */
  --ink:        #26221C;   /* pencil near-black */
  --ink-soft:   #6E6659;   /* graphite          */
  --line:       #333029;   /* marker line       */
  --kraft:      #C9A877;   /* kraft brown       */
  --kraft-deep: #A97B3E;
  --on-kraft:   #241B0F;
  --shadowc:    #2B2620;   /* hard offset shadow*/
  --tape:       rgba(238,231,196,0.65);
  --hi:         rgba(201,168,119,0.38);   /* marker highlight */
  --line-soft:  rgba(51,48,41,0.28);

  /* type */
  --mono: ui-monospace,"SF Mono","Cascadia Mono","JetBrains Mono",Menlo,Consolas,monospace;
  --sans: "Quicksand", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;

  /* hand-drawn corner radii */
  --r-blob: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --r-slop: 10px 20px 8px 18px / 18px 10px 20px 8px;

  --maxw: 760px;
  --fast: 130ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #1D1A16;
    --paper-2:    #28231D;
    --ink:        #F0E7D8;
    --ink-soft:   #B4AA9B;
    --line:       #D8CDBB;
    --line-soft:  rgba(216,205,187,0.22);
    --shadowc:    #0C0A07;
    --tape:       rgba(214,205,180,0.16);
    --hi:         rgba(201,168,119,0.30);
    --on-kraft:   #241B0F;
  }
}

/* ---------- fonts ---------- */
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/Caveat-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/Quicksand-latin.woff2") format("woff2");
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* scanned paper grain laid over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'220'%20height%3D'220'%3E%3Cfilter%20id%3D'n'%3E%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.85'%20numOctaves%3D'2'%20stitchTiles%3D'stitch'/%3E%3CfeColorMatrix%20type%3D'saturate'%20values%3D'0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA%20type%3D'linear'%20slope%3D'0.5'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect%20width%3D'100%25'%20height%3D'100%25'%20filter%3D'url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  opacity: 0.55;
}
@media (prefers-color-scheme: dark) {
  body::after {
    mix-blend-mode: screen;
    opacity: 0.5;
  }
}

::selection { background: var(--kraft); color: #1a1408; }

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

img { max-width: 100%; }

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.4rem 4.5rem;
  position: relative;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 2px dashed var(--line-soft);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.85rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--ink);
  position: relative;
  line-height: 1;
}
.brand::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.22em;
  height: 0.22em;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'46'%20height%3D'10'%20viewBox%3D'0%200%2046%2010'%3E%3Cpath%20d%3D'M2%206%20C10%201,18%2010,24%206%20S38%202,42%205'%20fill%3D'none'%20stroke%3D'%23B08952'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 40px 100%;
  opacity: 0.45;
  transition: opacity var(--fast) ease-out;
}
.brand:hover::after { opacity: 1; }

.nav-links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  border-bottom: 2px dashed transparent;
  padding-bottom: 2px;
  transition: color var(--fast) ease-out, border-color var(--fast) ease-out;
}
.nav-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--kraft-deep);
}

/* ---------- hero ---------- */
.hero {
  padding: 2.8rem 0 4rem;
  text-align: center;
}

.name {
  margin: 0;
  display: inline-block;
  position: relative;
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(5rem, 20vw, 9.5rem);
  line-height: 0.95;
  color: var(--ink);
  transform: rotate(-1.4deg);
}
.name::after {
  content: "";
  position: absolute;
  left: 5%; right: 5%;
  bottom: -0.16em;
  height: 0.3em;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20width%3D'46'%20height%3D'10'%20viewBox%3D'0%200%2046%2010'%3E%3Cpath%20d%3D'M2%206%20C10%201,18%2010,24%206%20S38%202,42%205'%20fill%3D'none'%20stroke%3D'%23B08952'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 68px 100%;
  opacity: 0.9;
}

.tagline {
  margin: 2rem auto 2.3rem;
  max-width: 36rem;
  font-family: var(--hand);
  font-weight: 600;
  font-size: clamp(1.4rem, 4vw, 1.95rem);
  line-height: 1.35;
  color: var(--ink-soft);
}

.cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.55rem 1.5rem 0.7rem;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--r-blob);
  box-shadow: 4px 4px 0 var(--shadowc);
  transform: rotate(-0.5deg);
  transition: transform var(--fast) ease-out, box-shadow var(--fast) ease-out, background var(--fast) ease-out;
}
.btn + .btn { transform: rotate(0.7deg); }
.btn:hover {
  transform: translate(-1px, -1px) rotate(-0.2deg);
  box-shadow: 6px 6px 0 var(--shadowc);
}
.btn-primary {
  background: var(--kraft);
  border-color: var(--kraft-deep);
  color: var(--on-kraft);
  box-shadow: 4px 4px 0 var(--kraft-deep);
}
.btn-primary:hover { box-shadow: 6px 6px 0 var(--kraft-deep); }

/* ---------- sections ---------- */
.section {
  padding: 2.9rem 0 2.5rem;
  border-top: 2px dashed var(--line-soft);
  scroll-margin-top: 90px;
}

.section h2 {
  display: inline-block;
  margin: 0 0 1.5rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.section h2::after {
  content: "";
  display: block;
  margin-top: 0.45rem;
  height: 4px;
  background: var(--kraft-deep);
}

.lede { margin: 0 0 1.25rem; }

/* About: facts as a paper note */
.facts {
  list-style: none;
  margin: 0;
  padding: 1.35rem 1.6rem 1.5rem;
  position: relative;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--r-slop);
  box-shadow: 4px 4px 0 var(--shadowc);
  transform: rotate(-0.35deg);
  display: grid;
  gap: 0.65rem;
}
/* masking tape holding the note down */
.facts::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(1.6deg);
  width: 96px;
  height: 26px;
  background: var(--tape);
  border-left: 1px dashed rgba(120,110,80,0.35);
  border-right: 1px dashed rgba(120,110,80,0.35);
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.facts li {
  color: var(--ink);
  padding-left: 1.7rem;
  position: relative;
}
.facts li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--kraft-deep);
  font-weight: 700;
}

/* ---------- link lists (Sites) ---------- */
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.link-list li > a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.25rem 0.95rem;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--r-slop);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadowc);
  transition: transform var(--fast) ease-out, box-shadow var(--fast) ease-out;
}
.link-list li:nth-child(1) > a { transform: rotate(-0.5deg); }
.link-list li:nth-child(2) > a { transform: rotate(0.4deg); }
.link-list li:nth-child(3) > a { transform: rotate(-0.3deg); }
.link-list li > a:hover {
  text-decoration: none;
  transform: translate(1px, -2px) rotate(0deg);
  box-shadow: 6px 6px 0 var(--kraft-deep);
}

.link-title { font-family: var(--hand); font-weight: 700; font-size: 1.6rem; line-height: 1; }
.link-desc { color: var(--ink-soft); font-size: 0.92rem; margin-left: auto; }
.link-arrow { color: var(--kraft-deep); font-size: 1.2rem; font-weight: 700; }

/* ---------- social (Elsewhere) ---------- */
.social-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}
.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--shadowc);
  transition: transform var(--fast) ease-out, box-shadow var(--fast) ease-out, background var(--fast) ease-out, color var(--fast) ease-out;
}
.social-row li:nth-child(1) a { transform: rotate(-3deg); }
.social-row li:nth-child(2) a { transform: rotate(2.5deg); }
.social-row a:hover {
  transform: rotate(0deg) translateY(-2px);
  background: var(--kraft);
  color: var(--on-kraft);
  box-shadow: 5px 5px 0 var(--kraft-deep);
}
.social-row svg { width: 1.55rem; height: 1.55rem; }

/* ---------- bottom photo: taped polaroid ---------- */
.bottom-photo {
  width: 78%;
  max-width: 330px;
  margin: 4.2rem auto 0;
  padding: 0.9rem 0.9rem 0.7rem;
  background: color-mix(in srgb, var(--paper) 70%, #fff 30%);
  border: 1px solid var(--line-soft);
  box-shadow: 5px 5px 0 var(--shadowc);
  transform: rotate(-2deg);
  position: relative;
  text-align: center;
}
.bottom-photo::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 104px;
  height: 26px;
  background: var(--tape);
  border-left: 1px dashed rgba(120,110,80,0.35);
  border-right: 1px dashed rgba(120,110,80,0.35);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.bottom-photo img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.bottom-photo figcaption {
  margin-top: 0.7rem;
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 3.5rem;
  border-top: 2px dashed var(--line-soft);
  padding: 1.9rem 1.4rem 2.6rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.site-footer p { margin: 0; }
.site-footer .icp { margin-top: 0.6rem; font-size: 0.85rem; }
.site-footer .icp a {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.site-footer .icp a:hover { color: var(--ink); }

/* ---------- boot loading (seven-petal spiral) ---------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--paper, #FAF7F0);
  color: var(--ink, #26221C);
  opacity: 1;
}
/* entrance/exit are driven frame-by-frame in loader.js */
#boot.is-hidden { pointer-events: none; }
/* no-JS / reduced-motion safety */
@media (prefers-reduced-motion: reduce) {
  #boot { display: none !important; }
}

#boot-loader {
  width: min(44vw, 250px);
  height: auto;
  overflow: visible;
  will-change: opacity, transform;
}
/* kraft-brown lead particle rides the ink trail */
#boot-loader .lead { fill: var(--kraft-deep, #A97B3E); }

/* content eases up as the paper curtain lifts */
body.reveal main,
body.reveal .site-footer {
  animation: rise-in 0.85s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- click ripple (heptagon) ---------- */
.click-fx {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}
.click-fx__ring {
  position: absolute;
  width: 108px;
  height: 108px;
  color: var(--ink, #26221C);
  will-change: transform, opacity;
}
.click-fx__ring svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.click-fx__ring path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* ---------- misc ---------- */
.mono { font-family: var(--mono); }

:focus-visible {
  outline: 2.5px dashed var(--kraft-deep);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand::after { opacity: 0.45; }
  * { transition: none !important; }
  .name, .tagline, .btn, .btn + .btn, .facts, .section h2,
  .link-list li > a, .social-row a, .bottom-photo { transform: none; }
}

@media (max-width: 520px) {
  .link-desc { display: none; }
  .nav-links { gap: 1.1rem; }
  .hero { padding-top: 2rem; }
  .facts { padding-left: 1.2rem; padding-right: 1.2rem; }
  .link-list li > a { padding: 0.8rem 1.05rem; }
}
