/* ==========================================================================
   Trace — hand-sketched notebook portfolio template · archesign.studio
   1. Tokens  2. Base  3. Header  4. Components  5. Pages  6. Footer  7. Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --paper: #fbf8ef;
  --rule: #cfdcef;
  --margin: #e8a0a0;
  --ink: #1f3a8a;
  --pencil: #555555;
  --marker: #fff176;
  --pink: #ffd1dc;
  --mint: #cdeccf;

  --font-hand: "Kalam", "Comic Sans MS", cursive;
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(18px, 3vw, 44px);
  --max: 1200px;
  --space: clamp(80px, 10vw, 140px);
  --line: 32px;
  --wobbly: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --wobbly-2: 15px 255px 15px 225px / 225px 15px 255px 15px;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--pencil); font: 300 17px/var(--line) var(--font-sans); -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  background-image: linear-gradient(90deg, transparent calc(var(--gutter) * .6), var(--margin) calc(var(--gutter) * .6), var(--margin) calc(var(--gutter) * .6 + 2px), transparent calc(var(--gutter) * .6 + 2px)), repeating-linear-gradient(transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line)); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 var(--line); }
h1, h2, h3 { font-family: var(--font-hand); font-weight: 700; color: var(--ink); margin: 0; line-height: 1.1; }
mark { background: linear-gradient(100deg, transparent 2%, var(--marker) 4%, var(--marker) 96%, transparent 98%); color: inherit; padding: 0 .12em; }
:focus-visible { outline: 2px dashed var(--ink); outline-offset: 4px; }
::selection { background: var(--marker); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 0 calc(var(--gutter) * 1.4); }
.section { padding: var(--space) 0; }
.hand { font: 400 20px/1.2 var(--font-hand); color: var(--ink); margin: 0 0 10px; }
.squiggle { display: inline-block; padding-bottom: 6px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 4 Q5 0 10 4 T20 4 T30 4 T40 4' fill='none' stroke='%23e8a0a0' stroke-width='2'/%3E%3C/svg%3E") repeat-x bottom left / 40px 8px; }

/* 3. Header ---------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 2px solid var(--ink); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.logo { display: flex; flex-direction: column; font: 700 28px/1 var(--font-hand); color: var(--ink); }
.logo small { font: 300 13px var(--font-hand); color: var(--pencil); margin-top: 4px; }
.site-nav { display: flex; gap: 8px; }
.site-nav a { font: 400 20px var(--font-hand); color: var(--ink); padding: 4px 12px; border: 2px solid transparent; border-radius: var(--wobbly); }
.site-nav a:hover { border-color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--marker); border-color: var(--ink); }
.menu-btn { display: none; }

/* 4. Components ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 22px; border: 2.5px solid var(--ink); border-radius: var(--wobbly); background: var(--paper); color: var(--ink); font: 700 20px var(--font-hand); cursor: pointer; box-shadow: 3px 4px 0 var(--ink); transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translate(-1px, -2px) rotate(-1deg); box-shadow: 5px 6px 0 var(--ink); }
.btn--marker { background: var(--marker); }
.sketch { background: #fff; border: 2px solid var(--ink); border-radius: var(--wobbly); padding: 12px; box-shadow: 4px 5px 0 rgba(31, 58, 138, .2); position: relative; }
.sketch:nth-child(even) { border-radius: var(--wobbly-2); }
.tape { position: relative; }
.tape::before { content: ""; position: absolute; top: -14px; left: 50%; width: 96px; height: 26px; margin-left: -48px; background: rgba(255, 241, 118, .7); rotate: -4deg; z-index: 2; }
.note-arrow { font: 400 19px/1.2 var(--font-hand); color: #c0392b; }
.js .reveal { opacity: 0; transition: opacity .7s ease; }
.js .reveal.is-in { opacity: 1; }

/* 5. Pages ----------------------------------------------------------------- */
/* hero spread */
.spread { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(26px, 5vw, 70px); align-items: center; padding-top: var(--line); }
.spread h1 { font-size: clamp(48px, 6.4vw, 100px); }
.spread .lead { font-size: 19px; max-width: 40ch; margin: var(--line) 0; }
.spread .actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-sketch { rotate: 1.5deg; }
.hero-sketch img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-sketch .note-arrow { position: absolute; right: 18px; bottom: -40px; rotate: -4deg; }
.hero-sketch .note-arrow::before { content: "↖ "; }

/* list of ideas */
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { display: grid; grid-template-columns: 34px 1fr; align-items: start; font: 400 22px/var(--line) var(--font-hand); color: var(--ink); }
.todo li::before { content: "☐"; font-family: var(--font-sans); color: var(--pencil); }
.todo li.done::before { content: "☑"; color: #2e8b57; }
.todo li.done span { text-decoration: line-through; text-decoration-color: #c0392b; text-decoration-thickness: 2px; color: var(--pencil); }

/* sketch cards */
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: var(--line); }
.sec-head h2 { font-size: clamp(38px, 4.6vw, 64px); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 30px; }
.card { display: block; transition: rotate .2s; }
.cards .card:nth-child(3n + 1) { rotate: -1.5deg; }
.cards .card:nth-child(3n + 2) { rotate: 1deg; }
.cards .card:nth-child(3n) { rotate: -.5deg; }
.cards .card:hover { rotate: 0deg; }
.card img { width: 100%; aspect-ratio: 9 / 7; object-fit: cover; }
.card h3 { font-size: 26px; margin-top: 10px; }
.card p { margin: 0; font: 300 15px/1.4 var(--font-sans); }
.card .date { font: 400 15px var(--font-hand); color: #c0392b; }

/* page head */
.page-head { padding: calc(var(--line) * 2) 0 var(--line); }
.page-head h1 { font-size: clamp(54px, 8vw, 120px); }
.page-head p { max-width: 54ch; font-size: 19px; margin: var(--line) 0 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: calc(var(--line) * 1.5); }
.filters button { font: 400 19px var(--font-hand); color: var(--ink); background: transparent; border: 2px solid var(--ink); border-radius: var(--wobbly); padding: 2px 16px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--marker); }

/* annotated project */
.annot { position: relative; margin-top: var(--line); }
.annot img { width: 100%; aspect-ratio: 14 / 9; object-fit: cover; }
.annot .n { position: absolute; font: 400 18px/1.15 var(--font-hand); color: #c0392b; background: rgba(251, 248, 239, .9); padding: 4px 8px; max-width: 200px; }
.annot .n1 { left: 4%; top: 8%; rotate: -3deg; }
.annot .n2 { right: 5%; top: 14%; rotate: 2deg; }
.annot .n3 { left: 40%; bottom: 8%; rotate: -1deg; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 60px); align-items: start; }
.two .sketch img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { display: grid; grid-template-columns: 130px 1fr; font-size: 16px; }
.facts b { font: 400 20px var(--font-hand); color: var(--ink); }
.story { font-size: 18px; }

/* about */
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(24px, 5vw, 60px); align-items: start; }
.about .sketch { rotate: -2deg; }
.about .sketch img { aspect-ratio: 6 / 7; object-fit: cover; width: 100%; }

/* workshops */
.offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.offer { padding: 22px; }
.offer:nth-child(1) { background: var(--pink); }
.offer:nth-child(2) { background: var(--mint); }
.offer:nth-child(3) { background: #dfe7f5; }
.offer h3 { font-size: 30px; margin-bottom: 8px; }
.offer p { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }
.offer .price { font: 700 22px var(--font-hand); color: var(--ink); }
.faq { max-width: 860px; }
.faq details { padding: 4px 0; }
.faq summary { display: block; position: relative; padding-left: 34px; cursor: pointer; list-style: none; font: 400 23px/var(--line) var(--font-hand); color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "→"; position: absolute; left: 0; top: 0; color: #c0392b; transition: rotate .2s; }
.faq details[open] summary::before { rotate: 90deg; }
.faq details p { margin: 0 0 var(--line) 34px; }

/* contact */
.contact { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 5vw, 60px); align-items: start; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.form > *, .field { min-width: 0; }
.field { display: flex; flex-direction: column; margin-bottom: var(--line); }
.field--full, .actions, .form-note { grid-column: 1 / -1; }
.field label { font: 400 20px/var(--line) var(--font-hand); color: var(--ink); }
.field input, .field select, .field textarea { font: 400 22px/var(--line) var(--font-hand); color: var(--pencil); background: transparent; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; padding: 0; height: var(--line); min-width: 0; max-width: 100%; }
.field textarea { height: auto; min-height: calc(var(--line) * 5); border-bottom: 0; resize: vertical; background: transparent; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: rgba(255, 241, 118, .35); }
.form-note { margin: 0; font: 400 21px var(--font-hand); color: #2e8b57; }
.postit { background: var(--marker); padding: 22px; rotate: 2deg; box-shadow: 4px 6px 12px -6px rgba(0, 0, 0, .35); }
.postit h3 { font-size: 28px; margin-bottom: 6px; }
.postit p { font-size: 15px; line-height: 1.5; margin: 0 0 10px; }

/* 6. Footer ---------------------------------------------------------------- */
.site-footer { margin-top: var(--space); border-top: 2px solid var(--ink); padding: calc(var(--line) * 2) 0 var(--line); }
.f-note h2 { font-size: clamp(36px, 5vw, 70px); max-width: 18ch; }
.f-note p { margin: var(--line) 0; font-size: 18px; }
.f-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--gutter); margin-top: calc(var(--line) * 2); font-size: 15px; }
.f-logo { font: 700 26px/1 var(--font-hand); color: var(--ink); margin: 0 0 8px; }
.f-grid p { line-height: 1.6; margin-bottom: 8px; }
.f-grid a:hover { color: var(--ink); text-decoration: underline wavy var(--margin); }
.f-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: var(--line) 0 0; font: 400 16px var(--font-hand); }

/* 7. Responsive ------------------------------------------------------------ */
@media (max-width: 1000px) {
  .cards, .offers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-block; position: relative; z-index: 60; font: 700 20px var(--font-hand); color: var(--ink); background: var(--marker); border: 2px solid var(--ink); border-radius: var(--wobbly); padding: 2px 16px; cursor: pointer; }
  .site-nav { position: fixed; inset: 0; z-index: 55; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: 0 var(--gutter) 0 calc(var(--gutter) * 1.6); background-color: var(--paper); background-image: repeating-linear-gradient(transparent 0 47px, var(--rule) 47px 48px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
  .site-nav a { font-size: 44px; line-height: 1.1; }
  .menu-open .site-nav { opacity: 1; visibility: visible; }
  .menu-open { overflow: hidden; }
  .spread, .two, .about, .contact, .form { grid-template-columns: 1fr; }
  .f-grid { grid-template-columns: 1fr 1fr; }
  .f-grid > :first-child { grid-column: 1 / -1; }
  .sec-head { flex-direction: column; align-items: flex-start; }
  .annot .n { font-size: 15px; max-width: 150px; }
}
@media (max-width: 560px) {
  .cards, .offers { grid-template-columns: 1fr; }
  .spread h1 { font-size: 48px; }
  .annot .n2 { display: none; }
  .facts li { grid-template-columns: 100px 1fr; }
  .about .sketch { max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
