/* What every page shares (the home page and each post): the colours and type, the focus ring and skip link,
   the cursor, the fixed menu with its flags, the buttons, the contact links, the footer and the film grain.
   The home page's rows and sections are in home.css. */
.cin {
  --bg: #070707; --text: #ece7df; --dim: #9a948a; --amber: #e8b86a; --teal: #6fb7c4; --line: rgb(236 231 223 / 0.14);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --t2f: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --joj: 'Fraunces', Georgia, serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --move: 1s cubic-bezier(0.22, 1, 0.36, 1);
  /* the page's side margin */
  --gut: clamp(1.25rem, 4vw, 4rem);
  background: var(--bg); color: var(--text); font: 300 1.0625rem/1.7 var(--sans);
}
.cin ::selection { background: var(--amber); color: #111; }
.cin h1, .cin h2, .cin h3 { font-family: var(--serif); font-weight: 400; line-height: 0.98; letter-spacing: -0.01em; }
.cin em { font-style: italic; color: var(--amber); }
.cin a { text-decoration-color: rgb(232 184 106 / 0.5); text-underline-offset: 0.2em; }
.cin-kicker { font: 500 0.75rem/1 var(--sans); letter-spacing: 0.28em; text-transform: uppercase; color: var(--amber); }

/* ---------- keyboard: a skip link, and one visible focus ring everywhere ---------- */
.cin :focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.skip-link { position: absolute; z-index: 70; left: 1rem; top: 0.6rem; display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.7rem 1rem; border-radius: 999px; background: var(--amber); color: #111; font: 600 0.8rem/1 var(--sans); text-decoration: none; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
main:focus { outline: none; }

/* ---------- cursor ---------- */
.cur { position: fixed; z-index: 1500; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 1px solid rgb(236 231 223 / 0.6); pointer-events: none; opacity: 0; display: grid; place-items: center; transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background 0.3s, border-color 0.3s, opacity 0.3s; mix-blend-mode: difference; }
.cur[data-on='true'] { opacity: 1; }
.cur[data-mode='link'] { width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: #fff; }
/* over buttons with words (.cin-btn, the email links) only the system pointer shows: the ring would cover them */
.cur[data-mode='none'] { opacity: 0; }
.cur[data-mode]:not([data-mode='']):not([data-mode='link']):not([data-mode='none']) { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: #fff; mix-blend-mode: normal; border-color: #fff; }
.cur-label { font: 600 0.62rem/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: #111; }

/* ---------- fixed navigation: logo, three links and the language switch ---------- */
.cin-nav { position: fixed; z-index: 60; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.9rem clamp(1rem, 3vw, 2.5rem); color: #fff; background: linear-gradient(rgb(7 7 7 / 0.82), rgb(7 7 7 / 0.55)); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid rgb(255 255 255 / 0.06); }
.cin-mark { display: inline-grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; margin-left: -0.6rem; font: 400 1.5rem/1 var(--serif); letter-spacing: 0.04em; text-decoration: none; }
.cin-menu { display: flex; margin-left: auto; gap: clamp(0.9rem, 2.4vw, 2.4rem); }
/* language switch: two flag cards fanned like a hand. Each card (the link) stays put so its hover
   area never moves; only the face inside it moves. Entering the hand gives both cards a jiggle;
   the card under the pointer pops up and stands straight. The current language is ringed. */
.cin-langs { position: relative; flex: none; width: 4.2rem; height: 2.5rem; margin: 0; }
/* the link is the 2rem-wide tap target; the flag face inside it stays card-sized */
.lang-card { --lean: 8deg; position: absolute; top: 0.25rem; left: 50%; width: 2rem; height: 2rem; margin-left: -1rem; display: grid; place-items: center; transform-origin: 50% 135%; transition: transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1); }
.lang-en { transform: translateX(-0.55rem) rotate(calc(var(--lean) * -1)); }
.lang-pt { transform: translateX(0.55rem) rotate(var(--lean)); }
.lang-card[aria-current] { --lean: 5deg; z-index: 2; }
.lang-face { display: block; width: 1.4rem; height: 1.95rem; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 1.5px #0b0b0b; filter: saturate(0.45) brightness(0.85); transition: transform 0.4s cubic-bezier(0.3, 1.5, 0.5, 1), filter 0.3s, box-shadow 0.3s; }
.lang-face .flag { display: block; width: 100%; height: 100%; }
.lang-card[aria-current] .lang-face { filter: none; box-shadow: 0 0 0 1.5px #0b0b0b, 0 0 0 3px var(--amber); }
.lang-card:focus-visible { outline-offset: 1px; border-radius: 6px; }
@media (hover: hover) {
  .cin-langs:hover .lang-face { animation: jiggle 0.6s ease-in-out; }
  .cin-langs:hover .lang-pt .lang-face { animation-delay: 0.08s; }
  .lang-card:hover { z-index: 3; }
  .lang-en:hover .lang-face { transform: translateY(-6px) rotate(var(--lean)) scale(1.08); filter: none; }
  .lang-pt:hover .lang-face { transform: translateY(-6px) rotate(calc(var(--lean) * -1)) scale(1.08); filter: none; }
}
@keyframes jiggle { 30% { translate: 0 -3px; rotate: -4deg; } 60% { translate: 0 0; rotate: 3deg; } }
@media (prefers-reduced-motion: reduce) { .cin-langs:hover .lang-face { animation: none; } }
.cin-menu a { position: relative; display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; font: 500 0.75rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; padding-block: 0.4rem; opacity: 0.62; transition: opacity 0.3s; white-space: nowrap; }
.cin-menu a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0.45rem; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease); }
.cin-menu a:hover, .cin-menu a[aria-current], .cin-menu a:focus-visible { opacity: 1; }
.cin-menu a[aria-current]::after { transform: scaleX(1); }
/* wide screens: all six in one line (the More list is just part of it there, and its button is hidden) */
.menu-more { display: contents; }
.menu-toggle { display: none; }
/* the page's pause, at the end of the line: a quiet icon as dim as the links, its words only on phones */
.menu-pause { all: unset; box-sizing: border-box; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-width: 2.75rem; min-height: 2.75rem; margin-inline: -0.5rem; color: inherit; opacity: 0.62; cursor: pointer; transition: opacity 0.3s; }
.menu-pause:hover, .menu-pause:focus-visible { opacity: 1; }
.menu-pause:focus-visible { outline: 2px solid var(--amber); outline-offset: -4px; border-radius: 999px; }
.menu-pause svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.menu-pause .i-play { display: none; fill: currentColor; stroke-width: 1.5; }
.menu-pause[data-paused] .i-pause { display: none; }
.menu-pause[data-paused] .i-play { display: block; }
.menu-pause span { display: none; }
html:not(.js-rails) .menu-pause, .menu-pause[hidden] { display: none; }
/* between phones and wide screens the menu loses its letter-spacing before anything else */
@media (max-width: 1100px) { .cin-menu { gap: 1.1rem; } .cin-menu a { letter-spacing: 0.1em; } }
/* phones: Career, Projects and a More button; the other four open in a short list under the header
   (rails.tsx). Without JS there's no button, and Contact stands in for it. The links keep 44px of height
   to tap, and spread across the space between the logo and the flags. */
@media (max-width: 760px) {
  .cin-nav { gap: 0.25rem; padding-block: 0.4rem; padding-inline: 1rem 0.5rem; }
  .cin-menu { gap: 0; justify-content: center; flex: 1; }
  .cin-menu .menu-wide { display: none; }
  .cin-menu a, .menu-toggle { padding-inline: 0.45rem; letter-spacing: 0.06em; }
  .cin-menu a::after { left: 0.45rem; right: 0.45rem; }
  .js-rails .menu-toggle:not([hidden]) { all: unset; position: relative; display: inline-flex; align-items: center; gap: 0.3rem; min-height: 2.75rem; padding-inline: 0.45rem; font: 500 0.75rem/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.62; cursor: pointer; transition: opacity 0.3s; }
  .menu-toggle svg { width: 0.9rem; height: 0.9rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: rotate 0.3s var(--ease); }
  .js-rails .menu-toggle:hover, .js-rails .menu-toggle:focus-visible, .js-rails .menu-toggle[aria-expanded='true'], .js-rails .menu-toggle[data-current] { opacity: 1; }
  .js-rails .menu-toggle:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; border-radius: 6px; }
  .menu-toggle[aria-expanded='true'] svg { rotate: 180deg; }
  /* the section in view is one of the four under More: the button is underlined like a link would be */
  .menu-toggle::after { content: ''; position: absolute; left: 0.45rem; right: 0.45rem; bottom: 0.45rem; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease); }
  .menu-toggle[data-current]::after { transform: scaleX(1); }
  /* the list: a quiet panel under the header, one section per line */
  .js-rails .cin-menu:has(.menu-toggle:not([hidden])) .menu-more { position: absolute; top: 100%; left: 0; right: 0; display: none; padding: 0.35rem 1rem 0.75rem; background: #0a0a0a; border-bottom: 1px solid rgb(255 255 255 / 0.08); box-shadow: 0 24px 40px -20px rgb(0 0 0 / 0.9); }
  .js-rails .cin-menu:has(.menu-toggle:not([hidden])) .menu-more[data-open] { display: grid; }
  .js-rails .menu-more[data-open] a { display: flex; min-height: 3rem; padding-inline: 0.2rem; border-top: 1px solid rgb(255 255 255 / 0.06); font-size: 0.8rem; letter-spacing: 0.14em; }
  .js-rails .menu-more[data-open] a:first-child { border-top: 0; }
  /* the pause: the list's last line, its words beside the icon */
  .js-rails .menu-more[data-open] .menu-pause { justify-content: flex-start; min-height: 3rem; margin: 0; padding-inline: 0.2rem; border-top: 1px solid rgb(255 255 255 / 0.06); font: 500 0.8rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
  .js-rails .menu-more[data-open] .menu-pause span { display: inline; }
  .js-rails .menu-more[data-open] .menu-pause:focus-visible { outline-offset: -2px; border-radius: 6px; }
  .js-rails .menu-more[data-open] a::after { left: 0.2rem; right: auto; width: 1.5rem; bottom: 0.6rem; }
  .js-rails .menu-more[data-open] a[aria-current] { color: var(--amber); }
  /* under the header, over the page: a tap on it closes the list (rails.tsx) */
  .menu-scrim[data-open] { position: fixed; z-index: 55; inset: 0; background: rgb(0 0 0 / 0.55); animation: fade 0.2s ease-out; }
  /* the flags: each card's tap area is 44px square and they sit side by side; the faces still fan */
  .cin-langs { width: 5.5rem; height: 2.75rem; }
  .lang-card { top: 0; width: 2.75rem; height: 2.75rem; margin-left: -1.375rem; }
  .lang-en { transform: translateX(-1.375rem) rotate(calc(var(--lean) * -1)); }
  .lang-pt { transform: translateX(1.375rem) rotate(var(--lean)); }
  .lang-en .lang-face { translate: 0.8rem 0; }
  .lang-pt .lang-face { translate: -0.8rem 0; }
}

/* ---------- buttons ---------- */
.cin-btn { display: inline-flex; align-items: center; gap: 0.7rem; padding: 0.95rem 1.5rem; border-radius: 999px; background: var(--text); color: #0b0b0b; text-decoration: none; font: 600 0.82rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.cin-btn:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -14px rgb(236 231 223 / 0.5); }
.cin-btn span { transition: transform 0.4s var(--ease); }
.cin-btn:hover span { transform: translateX(5px); }
.cin-btn-joj { background: #ee9b6b; }
/* "How I built it · soon": a note beside the button, not a second button */
.cin-soon { font: italic 400 1.05rem/1.3 var(--serif); color: var(--dim); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
/* ---------- Hi: links ---------- */
/* contact links: email as the main button, then a row of equal social tiles (icon over label) */
.links { display: grid; gap: 1.1rem; justify-items: start; margin-top: 0.6rem; }
.foot-links { justify-items: center; }
.link-email { display: inline-flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1.4rem; border-radius: 999px; background: var(--amber); color: #111; text-decoration: none; font: 500 1rem/1 var(--sans); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.link-email:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -12px rgb(232 184 106 / 0.7); }
.link-email .social-icon { width: 1.35rem; height: 1.35rem; }
.socials { display: grid; grid-template-columns: repeat(6, 5.6rem); gap: 0.6rem; }
.socials a { display: grid; justify-items: center; align-content: center; gap: 0.6rem; height: 5.6rem; border-radius: 18px; border: 1px solid var(--line); background: rgb(255 255 255 / 0.025); color: var(--text); text-decoration: none; font: 500 0.75rem/1 var(--sans); letter-spacing: 0.04em; transition: color 0.3s, border-color 0.3s, background 0.3s, transform 0.4s var(--ease); }
.socials a:hover { color: var(--amber); border-color: rgb(232 184 106 / 0.55); background: rgb(232 184 106 / 0.07); transform: translateY(-3px); }
.socials .social-icon { width: 1.75rem; height: 1.75rem; }
.social-icon { flex: none; display: block; }
.social-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
@media (max-width: 720px) {
  .foot-links { width: min(100%, 26rem); }
  .socials { grid-template-columns: repeat(6, minmax(2.75rem, 1fr)); justify-self: stretch; gap: 0.45rem; }
  .socials a { height: auto; aspect-ratio: 1; border-radius: 16px; }
  .socials span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .socials .social-icon { width: 1.55rem; height: 1.55rem; }
  .link-email { font-size: 0.95rem; }
}


/* ---------- footer ---------- */
.cin-foot { display: grid; justify-items: center; text-align: center; gap: 1.6rem; padding: clamp(6rem, 14vh, 9rem) 1.5rem 8rem; background: radial-gradient(70% 50% at 50% 0%, rgb(111 183 196 / 0.1), transparent 70%), #050505; }
.cin-foot h2 { font-size: clamp(4rem, 2rem + 9vw, 10rem); }
.foot-links { justify-content: center; }
.cin-fine { font-size: 0.8rem; color: var(--dim); }

/* ---------- film grain ---------- */
.cin::after { content: ''; position: fixed; inset: 0; z-index: 900; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); animation: grain 0.8s steps(4) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }


.post-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin: 0; font: 500 0.75rem/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.post-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.post-tags li { padding: 0.35rem 0.6rem; border-radius: 999px; border: 1px solid var(--line); color: #d9d3c8; font: 500 0.75rem/1 var(--sans); letter-spacing: 0.04em; }

/* the grain holds still for reduced motion, and while the page's motion is paused (rails.tsx) */
.is-paused .cin::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .cin::after { animation: none; } }
