/* ستایش سهیلی — one stylesheet, no framework.
   DNA shared by every "room": paper + ink, Vazirmatn/Naskh type, hairlines, one terracotta accent. */
:root {
  --paper: #faf8f4; --paper-2: #f0ece3; --card: #fff;
  --ink: #1a1a18; --ink-2: #5b5b56; --line: rgba(26,26,24,.14);
  --accent: #a8391f; --sage: #56684f;
  --sans: "Pelak", "Vazirmatn", system-ui, sans-serif;
  --serif: "Pelak", "Vazirmatn", serif;
  --hand: "Pelak", "Vazirmatn", serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --gut: clamp(1.1rem, 4vw, 2.5rem);
  --ease: cubic-bezier(.2,.7,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; overflow-x: clip; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.9 var(--sans); overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: .3em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
.wrap { width: min(100% - 2*var(--gut), 72rem); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 99; }
.skip:focus { top: .5rem; }
.label { font: 500 .85rem/1.5 var(--sans); color: var(--ink-2); letter-spacing: 0; margin: 0 0 1.2rem; }
.empty { color: var(--ink-2); padding: 1.5rem 0; }
.more { font-size: .95rem; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.more:hover { color: var(--accent); }
.crumb { font-size: .9rem; color: var(--ink-2); margin-bottom: 1.5rem; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--accent); }

/* page transition: cross-document view transitions, zero JS */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

/* header + navigation state */
.top { padding-block: 1.1rem; }
.top__in { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: 1rem 2rem; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.15rem; text-decoration: none; display: inline-flex; align-items: center; gap: .55rem; }
.brand__dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent); transition: transform .4s var(--ease); }
.brand:hover .brand__dot { transform: scale(1.5); }
nav { display: flex; gap: .3rem 1.4rem; flex-wrap: wrap; font-size: .95rem; }
nav a { text-decoration: none; padding-block: .25rem; background: linear-gradient(var(--accent), var(--accent)) no-repeat 100% 100% / 0 2px; transition: background-size .28s var(--ease), color .2s; }
nav a:hover, nav a[aria-current] { background-size: 100% 2px; }
nav a[aria-current] { font-weight: 600; }

/* footer */
.foot { margin-top: clamp(4rem, 10vw, 8rem); border-top: 1px solid var(--line); padding-block: 2rem 3rem; font-size: .95rem; }
.foot__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; align-items: end; }
.foot p { margin: 0; }
.foot__name { font-weight: 700; line-height: 1.6; }
.foot__name span { font-weight: 400; color: var(--ink-2); }
.foot__links { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.foot__c { color: var(--ink-2); }

/* scroll reveal (only when JS is on, so content never hides without it) */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ───────── HOME: calm, formal ───────── */
.hero { text-align: center; padding-block: clamp(3.5rem, 11vw, 8rem) clamp(2.5rem, 7vw, 5rem); }
.hero__h { font-size: clamp(3rem, 11vw, 7rem); font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.hero__p { font: 400 clamp(1.15rem, 2.4vw, 1.6rem)/1.9 var(--serif); color: var(--ink-2); margin: 1.2rem auto 0; max-width: 30ch; }
.hero__cta { justify-content: center; display: flex; gap: .8rem; flex-wrap: wrap; margin: 2rem 0 0; }
.hero__rule { display: block; height: 1px; background: var(--ink); margin-top: clamp(2.5rem, 6vw, 4.5rem); transform-origin: right; animation: rule 1s .3s var(--ease) both; }
@keyframes rule { from { transform: scaleX(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
[data-hero] { animation: rise .7s var(--ease) both; }
.hero__p[data-hero] { animation-delay: .15s; }
.hero__cta[data-hero] { animation-delay: .3s; }
.btn { display: inline-block; font-weight: 600; font-size: .98rem; padding: .6rem 1.4rem; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none; border-radius: 3px; transition: background .2s, color .2s; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.intro, .areas { display: block; text-align: center; padding-block: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--line); }
.contact-strip { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem 3rem; padding-block: clamp(2rem, 5vw, 3.5rem); border-top: 1px solid var(--line); }
.intro .label, .areas .label { display: inline-flex; align-items: center; gap: .8rem; margin-bottom: 1.6rem; }
.intro .label::before, .intro .label::after, .areas .label::before, .areas .label::after { content: ""; width: 2rem; height: 1px; background: var(--accent); }
.intro__t { font: 700 clamp(1.5rem, 3.6vw, 2.4rem)/1.8 var(--serif); max-width: 32ch; margin: 0 auto; text-wrap: balance; }
.areas__list { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; max-width: 46rem; }
.areas__list li { padding: .5rem 1.2rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); font-size: .98rem; transition: border-color .2s, transform .25s var(--ease); }
.areas__list li:hover { border-color: var(--accent); transform: translateY(-2px); }
.clist { margin: 0; display: grid; gap: 0; max-width: 40rem; }
.clist > div { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.clist dt { color: var(--ink-2); font-size: .9rem; }
.clist dd { margin: 0; }
.contact-strip { margin-top: 2rem; }
.contact .clist { border-top: 1px solid var(--ink); }

.sel, .notes { padding-top: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--line); }
.notes { margin-top: clamp(2.5rem, 6vw, 4rem); }
.sel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.label { margin: 0 0 1.2rem; }

/* ───────── WORK: structured / precise ───────── */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); counter-reset: r; }
.row { display: grid; grid-template-columns: 3rem 1fr 5rem 8rem 4rem 1.5rem; gap: 0 1rem; align-items: center; padding: 1.25rem .5rem; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .25s, padding .25s var(--ease); }
.row:hover { background: var(--paper-2); padding-inline: 1rem; }
.row__n { font: 500 .85rem var(--mono); color: var(--ink-2); font-family: var(--sans); }
.row__t { display: block; font-size: 1.35rem; font-weight: 700; line-height: 1.5; }
.row__s { display: block; color: var(--ink-2); font-size: .95rem; line-height: 1.7; }
.row__th img { width: 5rem; height: 3.4rem; object-fit: cover; border-radius: 2px; }
.row__c, .row__y { font-size: .9rem; color: var(--ink-2); }
.row__a { color: var(--accent); transition: transform .25s var(--ease); }
.row:hover .row__a { transform: translateX(-6px); }
li.empty { padding-inline: .5rem; }

.page-head { padding-block: clamp(2rem, 7vw, 5rem) clamp(1.5rem, 4vw, 3rem); }
.page-head h1 { font-size: clamp(2rem, 6vw, 4rem); font-weight: 800; max-width: 22ch; }
.page-head__p { color: var(--ink-2); margin-top: 1rem; }

/* ───────── PROJECT: one template, four personalities ───────── */
.proj { --pa: var(--accent); }
.ph { padding-block: clamp(1.5rem, 5vw, 4rem) 2rem; }
.ph__t { font-size: clamp(2.2rem, 7vw, 5rem); font-weight: 800; max-width: 18ch; }
.ph__s { font: 400 1.35rem/1.9 var(--serif); color: var(--ink-2); max-width: 36rem; margin-top: 1rem; }
.ph__meta { display: flex; flex-wrap: wrap; gap: .8rem 2.5rem; margin: 2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.ph__meta dt { font-size: .8rem; color: var(--ink-2); }
.ph__meta dd { margin: 0; font-weight: 500; }
.cover { margin-block: 1rem 3rem; }
.cover img { width: 100%; border-radius: 4px; }
.st h2 { font-size: .95rem; font-weight: 600; color: var(--pa); margin-bottom: .8rem; }
.story { display: grid; gap: clamp(2rem, 5vw, 3.5rem); padding-block: 1rem 2rem; }
.st { max-width: 44rem; }
.st--tech { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.gal { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin-block: 2rem; }
.gal img { width: 100%; border-radius: 4px; }
.gal figcaption { font-size: .85rem; color: var(--ink-2); margin-top: .4rem; }
.nextp { display: flex; justify-content: space-between; gap: 1rem; margin-block: 4rem 0; padding-block: 1.5rem; border-block: 1px solid var(--ink); text-decoration: none; transition: color .2s; }
.nextp span { color: var(--ink-2); }
.nextp:hover b { color: var(--pa); }

/* prose: shared by projects, notes, about. Markdown + trusted HTML land here */
.prose { max-width: 44rem; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { font-size: 1.6rem; margin: 2.2em 0 .6em; color: var(--ink); }
.prose h3 { font-size: 1.25rem; margin: 1.8em 0 .5em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li { margin-bottom: .35em; }
.prose img { border-radius: 4px; margin-block: 1.5em; }
.prose blockquote { margin: 1.8em 0; padding-inline-start: 1.2em; border-inline-start: 3px solid var(--accent); font-family: var(--serif); font-size: 1.2em; color: var(--ink-2); }
.prose code { font: .88em var(--mono); background: var(--paper-2); padding: .12em .4em; border-radius: 3px; }
.prose pre { direction: ltr; text-align: left; background: var(--ink); color: #f3eee4; padding: 1rem 1.2rem; border-radius: 6px; overflow-x: auto; line-height: 1.6; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95em; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .5em .7em; text-align: start; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose a { text-decoration-color: var(--accent); }
.project-note { background: var(--paper-2); border-inline-start: 3px solid var(--pa, var(--accent)); padding: 1rem 1.2rem; border-radius: 3px; margin: 1.5em 0; font-size: .95em; }
.todo { background: #fff6d6; border: 1px dashed #b09a3e; padding: .8rem 1rem; border-radius: 4px; font-family: var(--sans) !important; font-size: .95rem !important; }

/* industrial: grid paper, hairlines, data-like labels, numbered sections */
.proj--industrial { --pa: #2f4f4f; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 2.5rem 2.5rem; background-image: linear-gradient(rgba(26,26,24,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(26,26,24,.06) 1px, transparent 1px); background-position: -1px -1px; }
.proj--industrial .ph__t { font-family: var(--mono), var(--sans); font-family: var(--sans); text-transform: none; letter-spacing: -.02em; }
.proj--industrial .ph__meta { border: 1px solid var(--ink); background: var(--paper); padding: 0; gap: 0; }
.proj--industrial .ph__meta > div { padding: .7rem 1.2rem; border-inline-end: 1px solid var(--ink); }
.proj--industrial .story { counter-reset: s; gap: 0; border: 1px solid var(--ink); background: var(--paper); margin-block: 2rem; padding: 0; max-width: 72rem; }
.proj--industrial .st { max-width: none; display: grid; grid-template-columns: 9rem 1fr; gap: 1rem 2rem; padding: 1.6rem 1.4rem; border-bottom: 1px solid var(--ink); counter-increment: s; }
.proj--industrial .st:last-child { border-bottom: 0; }
.proj--industrial .st h2 { color: var(--ink); font: 600 .9rem var(--sans); margin: 0; }
.proj--industrial .st h2::before { content: counter(s, decimal-leading-zero); display: block; font: 500 2.4rem/1 var(--mono); color: var(--pa); margin-bottom: .4rem; direction: ltr; text-align: right; }
.proj--industrial .st--tech { border: 1px solid var(--ink); background: var(--paper); max-width: 72rem; margin-bottom: 1rem; }
.proj--industrial .st--result { background: var(--paper-2); }

/* bot: conversation. problem/context arrive, solution/result answer */
.proj--bot { --pa: #4a4a4a; }
.proj--bot .story { max-width: 44rem; gap: 1.6rem; }
.proj--bot .st { max-width: 88%; position: relative; padding: 1.1rem 1.4rem 1.2rem; border-radius: .9rem; background: var(--card); box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line); }
.proj--bot .st h2 { font-size: .8rem; margin-bottom: .3rem; }
.proj--bot .st--problem, .proj--bot .st--context { border-end-start-radius: .3rem; }
.proj--bot .st--solution, .proj--bot .st--result { margin-inline-start: auto; background: var(--pa); color: #fff; box-shadow: none; border-end-end-radius: .3rem; }
.proj--bot .st--solution h2, .proj--bot .st--result h2 { color: rgba(255,255,255,.75); }
.proj--bot .st--solution a, .proj--bot .st--result a { color: #fff; }
.proj--bot .st--tech { max-width: 44rem; }

/* web: image-heavy, type-heavy */
.proj--web { --pa: var(--accent); }
.proj--web .ph { padding-bottom: 1rem; }
.proj--web .ph__t { font-size: clamp(3rem, 12vw, 9rem); line-height: 1.1; max-width: none; }
.proj--web .cover { width: min(100%, 90rem); }
.proj--web .cover img { border-radius: 0; }
.proj--web .story { gap: 4rem; }
.proj--web .st { max-width: none; display: grid; grid-template-columns: 1fr 2fr; gap: 1rem 3rem; }
.proj--web .st .prose { font-size: 1.4rem; line-height: 2; max-width: 40rem; }
.proj--web .st h2 { font-size: 1.1rem; }

/* ───────── NOTES: a reading room, cool paper, magazine list ───────── */
.notes-page, .read { --paper: #eef1ee; --paper-2: #e2e7e2; --card: #fff; --accent: #2f5d50; --line: rgba(26,32,28,.15); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .9rem; font-size: .85rem; color: var(--ink-2); }
.meta b { font-weight: 600; color: var(--accent); }
.meta a { text-decoration: none; }
.nhead { padding-block: clamp(2rem, 6vw, 4.5rem) 1.5rem; }
.nhead h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 800; }
.nhead p { color: var(--ink-2); margin: .6rem 0 1.4rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips a { text-decoration: none; font-size: .9rem; padding: .25rem .9rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); transition: background .2s, color .2s, border-color .2s; }
.chips a:hover { border-color: var(--accent); }
.chips a[aria-current] { background: var(--accent); color: #fff; border-color: var(--accent); }
.lead { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; text-decoration: none; margin-block: 1rem 2rem; transition: border-color .25s; }
.lead:hover { border-color: var(--accent); }
.lead__img { width: 100%; height: 100%; min-height: 16rem; object-fit: cover; }
.lead__body { display: flex; flex-direction: column; gap: .9rem; padding: clamp(1.4rem, 4vw, 2.6rem); justify-content: center; }
.lead:not(:has(.lead__img)) { grid-template-columns: 1fr; }
.lead__t { font: 700 clamp(1.6rem, 3.6vw, 2.5rem)/1.55 var(--serif); }
.lead__e { color: var(--ink-2); font-size: 1.02rem; line-height: 1.9; }
.lead__more { color: var(--accent); font-weight: 600; font-size: .95rem; }
.ngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.4rem; }
.ncard { display: flex; flex-direction: column; gap: .7rem; padding: 1.3rem; background: var(--card); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; transition: border-color .25s, transform .25s var(--ease); }
.ncard:hover { border-color: var(--accent); transform: translateY(-3px); }
.ncard img { width: calc(100% + 2.6rem); max-width: none; margin: -1.3rem -1.3rem .3rem; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px 6px 0 0; }
.ncard__t { font: 700 1.3rem/1.65 var(--serif); }
.ncard__e { color: var(--ink-2); font-size: .95rem; line-height: 1.85; }

.note { display: grid; gap: .2rem 1.5rem; padding: 1.3rem 0; border-top: 1px solid var(--line); text-decoration: none; grid-template-columns: 8.5rem 1fr; }
.note time { grid-row: 1 / span 2; font-size: .9rem; color: var(--ink-2); padding-top: .35rem; }
.note__t { font: 700 1.4rem/1.6 var(--serif); transition: color .2s; }
.note__e { color: var(--ink-2); font-size: .98rem; line-height: 1.8; }
.note:hover .note__t { color: var(--accent); }
.notes .note:last-of-type { border-bottom: 1px solid var(--line); }

.progress { position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--accent); transform-origin: right; transform: scaleX(0); z-index: 50; }
@supports (animation-timeline: scroll()) { .progress { animation: grow linear both; animation-timeline: scroll(root); } @keyframes grow { to { transform: scaleX(1); } } }
.art__head { max-width: 42rem; padding-block: clamp(2rem, 6vw, 4.5rem) 2rem; margin-inline: auto; width: min(100% - 2*var(--gut), 42rem); }
.art__head h1 { font: 700 clamp(2.1rem, 5.5vw, 3.6rem)/1.5 var(--serif); margin: 1rem 0; }
.art__lede { font: 400 1.35rem/2 var(--serif); color: var(--ink-2); margin: 0; }
.art__cover { max-width: 60rem; margin: 0 auto 2.5rem; }
.art__cover img { width: 100%; height: auto; border-radius: 6px; }
.art__body { width: min(100% - 2*var(--gut), 42rem); margin-inline: auto; padding-bottom: 3rem; }
.prose--read { font: 400 1.25rem/2.15 var(--serif); }
.prose--read h2, .prose--read h3 { font-family: var(--sans); }
.prose--read h2 { border-top: 1px solid var(--line); padding-top: 1.2em; }
.art__upd { color: var(--ink-2); font-size: .88rem; margin-top: 2.5rem; }
.art__tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.art__tags span { font-size: .85rem; padding: .15rem .8rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-block: 2rem; border-top: 1px solid var(--line); }
.pn a { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; padding: 1rem 0; }
.pn small { color: var(--ink-2); }
.pn b { font: 700 1.15rem/1.6 var(--serif); }
.pn a:hover b { color: var(--accent); }
.pn__next { text-align: end; }

/* ───────── ABOUT: the same house, lights inverted ───────── */
.about { --paper: #1b1c1a; --paper-2: #262724; --card: #262724; --ink: #f0ede5; --ink-2: #a6a399; --line: rgba(240,237,229,.18); --accent: #e08a68; }
.about .btn { border-color: var(--ink); }
.about .prose--read { font-size: 1.4rem; line-height: 2.2; max-width: 40rem; }
.about .prose a { text-decoration-color: var(--accent); }
.contact { --paper: #f2f2f2; --paper-2: #e4e4e4; --card: #fff; --accent: #3a3a3a; --line: rgba(0,0,0,.16); }
.work { --paper: #ffffff; --paper-2: #f3f2ee; }
.about__contact ul { list-style: none; padding: 0; margin: 0; }
.about__contact li { display: flex; flex-direction: column; padding: .8rem 0; border-top: 1px solid var(--line); }
.about__contact li span { font-size: .8rem; color: var(--ink-2); }


/* ───────── POSTCARDS: playful, tactile ───────── */
.pcpage { background: #efe8db; }
.cta { display: inline-block; font: 600 1rem var(--sans); color: var(--paper); background: var(--ink); padding: .65rem 1.4rem; border-radius: 99px; text-decoration: none; transition: background .2s, transform .25s var(--ease); border: 0; cursor: pointer; }
.cta:hover { background: var(--accent); transform: translateY(-2px) rotate(-1deg); }
.cta--btn { margin-top: 1.2rem; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 2.2rem 1.6rem; padding-block: 1.5rem 3rem; }
.pcs { background: #efe8db; padding-block: 3rem; margin-top: 3rem; }
.pcs__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.8rem; padding-block: 1rem; }

.pc { all: unset; display: block; cursor: pointer; }
.pc:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 6px; }
.pc__card { position: relative; display: grid; grid-template-columns: 1fr 5.2rem; gap: 0; min-height: 12rem; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .35 0 0 0 0 .25 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); border-radius: 4px; box-shadow: 0 1px 2px rgba(28,26,23,.12), 0 6px 16px -8px rgba(28,26,23,.25); padding: 1rem 1.1rem; transform: rotate(var(--r, 0deg)); transition: transform .35s var(--ease), box-shadow .35s; overflow: hidden; }
.pc__card::after { content: ""; position: absolute; inset-block: .9rem; inset-inline-end: 6.6rem; border-inline-start: 1px solid var(--line); }
.pc:hover .pc__card, .pc:focus-visible .pc__card { transform: rotate(calc(var(--r, 0deg) * -.6)) translateY(-6px); box-shadow: 0 1px 2px rgba(28,26,23,.12), 0 14px 22px -12px rgba(28,26,23,.32); }
.wall > .pc:nth-child(6n+1), .pcs__row > .pc:nth-child(3n+1) { --r: -1.6deg; }
.wall > .pc:nth-child(6n+2), .pcs__row > .pc:nth-child(3n+2) { --r: 1.2deg; }
.wall > .pc:nth-child(6n+3), .pcs__row > .pc:nth-child(3n) { --r: -.7deg; }
.wall > .pc:nth-child(6n+4) { --r: 1.9deg; }
.wall > .pc:nth-child(6n+5) { --r: -1.1deg; }
.wall > .pc:nth-child(6n) { --r: .8deg; }
.pc__photo { grid-column: 1 / -1; width: calc(100% + 2.2rem); margin: -1rem -1.1rem .8rem; max-width: none; aspect-ratio: 16/9; object-fit: cover; }
.pc__body { display: flex; flex-direction: column; gap: .5rem; padding-inline-end: 1rem; }
.pc__from { font-size: .85rem; color: var(--ink-2); }
.pc__from b { font: 700 1.9rem/1.3 var(--hand); color: var(--accent); margin-inline-start: .2rem; }
.pc__msg { font: 400 1.02rem/1.9 var(--serif); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pc__by { margin-top: auto; font-size: .82rem; color: var(--ink-2); }
.pc__side { display: flex; flex-direction: column; align-items: center; gap: .9rem; padding-inline-start: .3rem; }
.pc__stamp { width: 3.9rem; padding: .6rem .2rem; text-align: center; border: 2px dashed var(--sage); color: var(--sage); font-size: .68rem; font-weight: 700; line-height: 1.4; border-radius: 2px; transform: rotate(3deg); background: rgba(86,104,79,.06); }
.pc__mark { width: 3.7rem; aspect-ratio: 1; border: 1.5px solid var(--ink-2); border-radius: 50%; display: grid; place-content: center; text-align: center; font-size: .58rem; line-height: 1.3; color: var(--ink-2); transform: rotate(-12deg); opacity: .7; }
.pc__mark i { font-style: normal; }
.pc__lines { margin-top: auto; width: 100%; display: grid; gap: .45rem; }
.pc__lines i { border-bottom: 1px solid var(--line); height: 1px; }
.pc__by em { font-style: normal; border: 1px solid var(--line); border-radius: 99px; padding: 0 .5rem; font-size: .72rem; }
.pc__sample-unused { position: absolute; inset-inline-start: .5rem; bottom: .4rem; font-size: .68rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 .5rem; background: var(--card); }
.pc__photo ~ .pc__body { grid-row: 2; }
.pc__photo ~ .pc__side { grid-row: 2; }
.pc__photo ~ .pc__side .pc__lines { display: none; }

/* enlarged card */
.pcd { border: 0; padding: 0; background: transparent; width: min(94vw, 40rem); max-height: 92vh; overflow: visible; color: inherit; }
.pcd::backdrop { background: rgba(28,26,23,.55); backdrop-filter: blur(3px); }
.pcd[open] { animation: pop .32s var(--ease); }
.pcd[open]::backdrop { animation: fade .3s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.94) rotate(-1.5deg) translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
.pcd__x { position: absolute; z-index: 2; top: -1rem; inset-inline-start: -.6rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.pcd .pc__card { --r: -.8deg; transform: none; min-height: 18rem; grid-template-columns: 1fr 6.5rem; padding: 1.6rem 1.8rem; max-height: 90vh; overflow: auto; }
.pcd .pc__card::after { inset-inline-end: 8.4rem; inset-block: 1.4rem; }
.pcd .pc__msg { -webkit-line-clamp: unset; display: block; font-size: 1.3rem; line-height: 2.1; }
.pcd .pc__from b { font-size: 2.6rem; }
.pcd .pc__photo { width: calc(100% + 3.6rem); margin: -1.6rem -1.8rem 1rem; }

/* writing side */
.write { padding-block: 1rem 2rem; }
.wcard { background: var(--card); border-radius: 4px; padding: clamp(1.2rem, 4vw, 2.2rem); box-shadow: 0 1px 2px rgba(28,26,23,.12), 0 14px 24px -14px rgba(28,26,23,.3); transform: rotate(-.4deg); position: relative; }
.wcard::before { content: ""; position: absolute; top: 1.2rem; inset-inline-start: 1.2rem; width: 3.2rem; height: 3.9rem; border: 2px dashed var(--sage); border-radius: 2px; opacity: .6; transform: rotate(3deg); }
.wcard h2 { font: 700 2rem/1.4 var(--hand); color: var(--accent); padding-inline-start: 4.4rem; }
.write__hint { color: var(--ink-2); padding-inline-start: 4.4rem; }
.wgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem 1.4rem; margin-top: 1.4rem; }
.fld { display: flex; flex-direction: column; gap: .25rem; }
.fld--message, .fld--image { grid-column: 1 / -1; }
.fld label { font-size: .85rem; color: var(--ink-2); }
.fld small { font-weight: 400; }
.fld input, .fld select, .fld textarea { font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1.5px solid var(--ink-2); padding: .45rem .1rem; border-radius: 0; min-height: 2.75rem; }
.fld textarea { line-height: 2; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 2px 0 var(--accent); }
.fld input[type=file] { border: 0; font-size: .9rem; }
.fld em { color: var(--accent); font-size: .85rem; font-style: normal; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.flash { padding: .7rem 1rem; border-radius: 4px; background: #e2ecdb; border: 1px solid var(--sage); }
.flash--error { background: #f6ddd6; border-color: var(--accent); }

/* ───────── responsive ───────── */
@media (max-width: 52rem) {
  .wgrid { grid-template-columns: 1fr; }
  .cgrid, .lead { grid-template-columns: 1fr; }
  .pn { grid-template-columns: 1fr; }
  body { font-size: 1rem; }
  .contact-strip { grid-template-columns: 1fr; gap: .2rem; }
  .row { grid-template-columns: 2rem 1fr auto; padding-inline: .2rem; }
  .row__c, .row__a, .row__th { display: none; }
  .note { grid-template-columns: 1fr; }
  .note time { grid-row: auto; padding: 0; }
  .note__m { grid-column: 1; }
  .prose--read { font-size: 1.15rem; }
  .proj--industrial .st, .proj--web .st { grid-template-columns: 1fr; }
  .proj--industrial .st h2::before { text-align: start; font-size: 1.8rem; }
  .proj--bot .st { max-width: 94%; }
  .wgrid { grid-template-columns: 1fr; }
  .wall { gap: 1.6rem; }
  .pc__card { --r: 0deg; }
  .wall > .pc:nth-child(odd) { --r: -.8deg; }
  .wall > .pc:nth-child(even) { --r: .6deg; }
}
@media (hover: none) { .pc:hover .pc__card { transform: rotate(var(--r, 0deg)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .js [data-reveal] { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
.hero + .intro { border-top: 0; }

/* contact */
.cgrid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 3rem 5rem; padding-block: 1rem 2rem; }
.cform .fld { margin-bottom: 1.1rem; }
.cform .fld input, .cform .fld textarea { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: .6rem .8rem; }
.cform .fld input:focus, .cform .fld textarea:focus { border-color: var(--accent); box-shadow: none; outline: 2px solid var(--accent); outline-offset: 1px; }
.socials { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 1rem 1.2rem; }
.soc { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-decoration: none; font-size: .78rem; color: var(--ink-2); width: 4.4rem; text-align: center; transition: color .2s; }
.soc svg, .soc b { width: 3rem; height: 3rem; padding: .8rem; border: 1px solid var(--line); border-radius: 50%; fill: var(--ink); background: var(--card); transition: background .2s, fill .2s, border-color .2s; }
.soc b { display: grid; place-content: center; padding: 0; font-size: .85rem; }
.soc:hover { color: var(--ink); }
.soc:hover svg { background: var(--ink); fill: var(--paper); border-color: var(--ink); }
.soc:hover b { background: var(--ink); color: var(--paper); }
.contact-strip > div > .more { display: inline-block; margin-top: 1rem; }

/* certificates */
.certs { padding-block: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--line); }
.certs__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1.5rem; }
.cert { display: flex; flex-direction: column; gap: .7rem; padding-top: .8rem; border-top: 1px solid var(--ink); }
.cert__img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border: 1px solid var(--line); border-radius: 2px; transition: transform .3s var(--ease); }
.cert__img:hover img { transform: translateY(-3px); }
.cert__t { font-weight: 600; line-height: 1.7; }
.cert__t a { text-decoration-color: var(--accent); }
.cert__t span { display: block; font-weight: 400; font-size: .88rem; color: var(--ink-2); }
.prose--read > h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* simple projects */
.simple { padding-block: 2rem; border-top: 1px solid var(--line); }
.simple__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 1.5rem; }
.sp { padding-top: .8rem; border-top: 1px solid var(--ink); }
.sp h3 { font-size: 1.1rem; margin: 0 0 .4rem; }
.sp h3 a { text-decoration: none; }
.sp p { margin: 0 0 .6rem; color: var(--ink-2); }
.sp__m { display: flex; flex-wrap: wrap; gap: .4rem .8rem; font-size: .8rem; }
.sp__m a { margin-inline-start: auto; }
.ph__links { display: flex; gap: .8rem; margin-top: 1.2rem; }

/* contact: formal list instead of round icons */
.contact .socials { flex-direction: column; gap: 0; margin: 0; border-top: 1px solid var(--ink); max-width: 40rem; }
.contact .socials li { border-bottom: 1px solid var(--line); }
.contact .soc { flex-direction: row; width: auto; gap: .8rem; padding: .8rem 0; font-size: .95rem; text-align: start; }
.contact .soc svg, .contact .soc b { width: 1.3rem; height: 1.3rem; padding: 0; border: 0; border-radius: 0; background: none; font-size: .8rem; }
.contact .soc:hover svg { background: none; fill: var(--accent); }
.contact .soc:hover b { background: none; color: var(--accent); }
.contact .clist { border-top: 0; }

/* landing contact */
.lcta { padding-block: clamp(2rem, 5vw, 3.5rem); }
.lcta__box { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem 3rem; align-items: center; padding: clamp(1.5rem, 4vw, 3rem); background: var(--card, #fff); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 4px; }
.lcta__t { font-size: clamp(1.4rem, 3.2vw, 2.1rem); font-weight: 800; margin: 0 0 .6rem; }
.lcta__p { color: var(--ink-2); margin: 0 0 1.4rem; max-width: 34ch; }
.lcta__btns { display: flex; flex-wrap: wrap; gap: .8rem; margin: 0; }
.lcta__soc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; }
.lcta__soc a { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; font-size: .9rem; transition: border-color .2s, background .2s; }
.lcta__soc a:hover { border-color: var(--accent); background: var(--paper-2); }
.lcta__soc svg { width: 1.15rem; height: 1.15rem; fill: currentColor; flex: none; }
@media (max-width: 760px) { .lcta__box { grid-template-columns: 1fr; } }

/* bot commands */
.bot-cmds { padding-block: 1.5rem; }
.bot-cmds ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; max-width: 40rem; }
.bot-cmds li { display: flex; gap: 1rem; align-items: baseline; padding: .6rem .9rem; background: var(--paper-2); border-radius: 4px 12px 12px 12px; }
.bot-cmds code { font-weight: 700; color: var(--accent); }

/* about cv */
.cv { padding-block: 1.5rem; border-top: 1px solid var(--line); }
.skills { margin: 0; display: grid; max-width: 44rem; }
.skills > div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.skills dt { color: var(--ink-2); font-size: .9rem; }
.skills dd { margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.skills dd span { padding: .15rem .7rem; border: 1px solid var(--line); border-radius: 99px; font-size: .88rem; }
.tl { list-style: none; margin: 0; padding: 0; max-width: 44rem; }
.tl li { padding: .8rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .2rem; }
.tl span { color: var(--ink-2); font-size: .88rem; }
.tl p { margin: .3rem 0 0; }
.cv__cta { display: flex; gap: .8rem; padding-block: 2rem; }

/* about: developer portfolio */
.ab-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem 3rem; align-items: center; padding-block: clamp(2.5rem, 7vw, 5rem); }
.ab-hero h1 { font-size: clamp(2.4rem, 7vw, 4.5rem); font-weight: 800; }
.ab-hero__p { color: var(--ink-2); font-size: 1.15rem; margin: 1rem 0 0; max-width: 34rem; }
.ab-hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 0; }
.code { margin: 0; padding: 1.2rem 1.4rem; background: #111210; color: #d9d6cc; border: 1px solid var(--line); border-radius: 6px; font: 400 .95rem/1.8 var(--mono); overflow-x: auto; text-align: left; }
.code .c-k { color: #e08a68; } .code .c-s { color: #9fb8a0; } .code .c-v { color: #e6d8a8; }
.ab-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.5rem; }
.ab-cols article { padding-top: .8rem; border-top: 1px solid var(--ink); }
.ab-cols h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.ab-cols p { color: var(--ink-2); margin: 0; }
.ab-works { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.ab-works li { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ab-works a { display: flex; flex-direction: column; text-decoration: none; }
.ab-works span, .ab-works small { color: var(--ink-2); font-size: .9rem; }
.ab-works small { direction: ltr; align-self: center; }
@media (max-width: 760px) { .ab-hero { grid-template-columns: 1fr; } }


/* hero swipe hint + settings dialog */
.swipe { display: inline-flex; margin-top: 2rem; direction: ltr; background: none; border: 0; padding: .4rem .8rem; color: var(--ink-2); font: 700 1.6rem/1 var(--mono); letter-spacing: -.15em; cursor: pointer; }
.swipe span { animation: nudge 1.6s ease-in-out infinite; opacity: .3; }
.swipe span:nth-child(2) { animation-delay: .2s; } .swipe span:nth-child(3) { animation-delay: .4s; }
.swipe:hover { color: var(--accent); }
@keyframes nudge { 50% { opacity: 1; transform: translateX(4px); } }
@media (min-width: 900px) { .swipe { display: none; } }
.set { border: 0; border-radius: 8px; padding: 0; width: min(92vw, 26rem); max-height: 86vh; background: var(--card); color: var(--ink); box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); }
.set::backdrop { background: rgba(20,20,18,.5); backdrop-filter: blur(3px); }
.set[open] { animation: pop .3s var(--ease); }
.set form { padding: 1.2rem 1.4rem 1.4rem; overflow: auto; max-height: 86vh; }
.set h2 { font-size: 1.15rem; margin-bottom: .3rem; }
.set p { color: var(--ink-2); font-size: .88rem; margin: 0 0 1rem; }
.set__list { display: grid; gap: .4rem; }
.set label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 1.05rem; }
.set label:has(input:checked) { border-color: var(--accent); background: var(--paper-2); }
.set label small { font: 400 .75rem system-ui; color: var(--ink-2); direction: ltr; }
.set input { accent-color: var(--accent); }
.set .btn { margin-top: 1rem; width: 100%; cursor: pointer; }
.rel { padding-block: 1.5rem; }
.rel ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.rel a { display: flex; flex-direction: column; padding: .8rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.rel a span { color: var(--ink-2); font-size: .9rem; }

/* contact: single column on phones (must come after the base .cgrid rule) */
@media (max-width: 52rem) {
  .cgrid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .cform .fld input, .cform .fld textarea { width: 100%; min-width: 0; }
  .clist > div { flex-wrap: wrap; }
}

.ab-sub { color: var(--ink-2); margin: -.6rem 0 1.2rem; }
