/* ------------------------------------------------------------------
   berkaycloud — quiet, warm, small.
   One narrow column, soft surfaces, one accent. No framework.
   ------------------------------------------------------------------ */

:root {
  --bg: #0f0f10;
  --surface: #151517;
  --surface-2: #1b1b1e;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #e9e7e2;
  --ink-2: #9a9893;
  --ink-3: #66655f;
  --accent: #d6ab5c;
  --accent-soft: rgba(214, 171, 92, 0.12);
  --ok: #7cc98b;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 12px 32px -12px rgba(0,0,0,.6);

  --font: "Instrument Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --col: 640px;
  --pad: clamp(1.25rem, 5vw, 2rem);
  --r: 12px;
  --r-s: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f1f0ec;
  --line: rgba(20, 20, 18, 0.08);
  --line-2: rgba(20, 20, 18, 0.14);
  --ink: #1b1b19;
  --ink-2: #6c6b66;
  --ink-3: #9d9c96;
  --accent: #a8792b;
  --accent-soft: rgba(168, 121, 43, 0.1);
  --ok: #2f9e4f;
  --shadow: 0 1px 2px rgba(20,20,18,.06);
  --shadow-2: 0 12px 32px -12px rgba(20,20,18,.18);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, dl, dd, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.08em; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: .5rem .75rem; background: var(--ink); color: var(--bg); border-radius: 6px;
  transform: translateY(-200%); transition: transform .2s; font-size: .8rem;
}
.skip:focus { transform: none; }

.wrap { max-width: var(--col); margin-inline: auto; padding-inline: var(--pad); }

.label {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.muted { color: var(--ink-2); }
.link { color: var(--ink); border-bottom: 1px solid var(--line-2); transition: border-color .25s; }
.link:hover { border-color: var(--accent); }

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .25s ease both; }
::view-transition-new(root) { animation: vt-in .4s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.is-scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: 1rem; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 500; font-size: .95rem; }
.brand img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); }
.top nav { margin-left: auto; display: flex; gap: .15rem; }
.top nav a {
  font-size: .86rem; color: var(--ink-2); padding: .35rem .6rem; border-radius: 6px;
  transition: color .2s, background-color .2s;
}
.top nav a:hover { color: var(--ink); background: var(--surface-2); }
.top nav a[aria-current="page"] { color: var(--ink); }
.tools { display: flex; align-items: center; gap: .35rem; margin-left: .25rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); }
.seg button { font-family: var(--mono); font-size: .62rem; letter-spacing: .06em; padding: .28rem .5rem; border-radius: 999px; color: var(--ink-2); transition: background-color .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.icon-btn {
  width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: color .2s, border-color .2s, transform .3s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); transform: rotate(-15deg); }
.icon-btn svg { width: 13px; height: 13px; }
.icon-btn .sun { display: none; }
html[data-theme="light"] .icon-btn .sun { display: block; }
html[data-theme="light"] .icon-btn .moon { display: none; }
@media (max-width: 560px) {
  .top .wrap { height: auto; padding-block: .75rem; flex-wrap: wrap; row-gap: .5rem; }
  .top nav { margin-left: 0; width: 100%; order: 3; }
  .top nav a { padding-left: 0; }
  .tools { margin-left: auto; }
}

/* ---------- sections ---------- */
main { padding-block: clamp(3rem, 8vh, 5rem) 3rem; display: grid; gap: clamp(3.5rem, 8vh, 5rem); }
.section { display: grid; gap: 1.1rem; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section__head h2 { font-size: 1rem; font-weight: 500; letter-spacing: -0.01em; }
.section__head a { font-size: .84rem; color: var(--ink-2); transition: color .2s; }
.section__head a:hover { color: var(--ink); }

/* ---------- intro ---------- */
.intro { display: grid; gap: 1.4rem; }
.intro__id { display: flex; align-items: center; gap: 1rem; }
.avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 1px solid var(--line-2); flex: none; box-shadow: var(--shadow); }
.avatar img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.2); transition: transform .6s var(--ease), filter .6s; }
.avatar:hover img { transform: scale(1.08) rotate(-3deg); filter: none; }
.intro h1 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.intro__sub { font-size: .9rem; color: var(--ink-2); margin-top: .15rem; }
.intro p.lede { font-size: 1.05rem; line-height: 1.6; color: var(--ink); text-wrap: pretty; max-width: 34em; }
.intro p.lede em { color: var(--accent); }
.intro__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  height: 36px; padding: 0 .9rem; border-radius: 999px;
  font-size: .86rem; font-weight: 500;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease), border-color .2s, background-color .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--ink-3); }
.btn svg { width: 13px; height: 13px; color: var(--ink-2); transition: color .2s, transform .3s var(--ease); }
.btn:hover svg { color: var(--ink); }
.btn:hover .arrow { transform: translate(1px, -1px); }
.btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--primary svg { color: var(--bg); opacity: .8; }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); }
.btn--accent { background: var(--accent); color: #1a1408; border-color: var(--accent); }
.btn--accent svg { color: #1a1408; }
.btn--accent:hover { border-color: var(--accent); }

/* status strip */
.now {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow);
  overflow: hidden;
}
.now > div { padding: .8rem 1rem; display: grid; gap: .2rem; border-left: 1px solid var(--line); min-width: 0; }
.now > div:first-child { border-left: 0; }
.now strong { font-weight: 500; font-size: .9rem; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.now i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); flex: none; }
@media (max-width: 560px) {
  .now { grid-template-columns: 1fr; }
  .now > div { border-left: 0; border-top: 1px solid var(--line); }
  .now > div:first-child { border-top: 0; }
}

/* ---------- principles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.tile {
  position: relative; padding: 1rem 1rem 1.05rem; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  display: grid; gap: .5rem; align-content: start;
  transition: transform .35s var(--ease), border-color .25s, box-shadow .35s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-2); }
.tile__icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.tile__icon svg { width: 15px; height: 15px; }
.tile:hover .tile__icon { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.tile h3 { font-size: .95rem; font-weight: 500; letter-spacing: -0.01em; margin-top: .2rem; }
.tile p { font-size: .86rem; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 480px) { .tiles { grid-template-columns: 1fr; } }

/* ---------- project list ---------- */
.list { display: grid; gap: .35rem; }
.item {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: .9rem;
  padding: .7rem .8rem; margin-inline: -.8rem; border-radius: var(--r);
  transition: background-color .2s;
}
.item:hover { background: var(--surface); }
.item__mark {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface-2);
  font-family: var(--mono); font-size: .8rem; color: var(--ink-2);
  transition: color .2s, border-color .2s, background-color .2s;
}
.item:hover .item__mark { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.item__text { display: grid; gap: .05rem; min-width: 0; }
.item__name { font-weight: 500; font-size: .95rem; display: flex; align-items: baseline; gap: .5rem; }
.item__name small { font-family: var(--mono); font-size: .62rem; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.item__desc { font-size: .86rem; color: var(--ink-2); line-height: 1.45; text-wrap: pretty; }
.item__arrow { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; color: var(--ink-3); border: 1px solid transparent; transition: color .2s, border-color .2s, transform .3s var(--ease); }
.item__arrow svg { width: 12px; height: 12px; }
.item:hover .item__arrow { color: var(--ink); border-color: var(--line-2); transform: translate(1px, -1px); }
@media (max-width: 480px) { .item__arrow { display: none; } .item { grid-template-columns: 38px minmax(0, 1fr); } }

/* ---------- stack chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .04em;
  padding: .32rem .6rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: color .2s, border-color .2s;
}
.chip:hover { color: var(--ink); border-color: var(--line-2); }

/* ---------- support card ---------- */
.card {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.3rem; display: grid; gap: .9rem;
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 60%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent); pointer-events: none;
}
.card h2 { font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em; }
.card h2 em { color: var(--accent); }
.card p { font-size: .9rem; color: var(--ink-2); line-height: 1.55; text-wrap: pretty; max-width: 40em; }
.card__actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card__note { font-size: .78rem; color: var(--ink-3); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding-block: 1.4rem 2.5rem; }
.foot .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-3); }
.foot a { color: var(--ink-2); transition: color .2s; }
.foot a:hover { color: var(--ink); }
.foot__links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- projects page ---------- */
.page-title { display: grid; gap: .5rem; }
.page-title h1 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; }
.page-title p { color: var(--ink-2); font-size: .95rem; max-width: 36em; text-wrap: pretty; }

.project {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.2rem; display: grid; gap: .8rem;
  transition: transform .35s var(--ease), border-color .25s, box-shadow .35s;
}
.project:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-2); }
.project__top { display: flex; align-items: center; gap: .8rem; }
.project__top .item__mark { flex: none; }
.project__title { display: grid; gap: .1rem; min-width: 0; }
.project__title h2 { font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em; }
.project__tag { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--accent); line-height: 1.3; }
.project__meta { margin-left: auto; display: grid; gap: .1rem; text-align: right; flex: none; }
.project p.desc { font-size: .9rem; color: var(--ink-2); line-height: 1.55; text-wrap: pretty; }
.project__foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.project__links { display: flex; gap: .4rem; }
.btn--sm { height: 32px; padding: 0 .75rem; font-size: .8rem; }
@media (max-width: 480px) { .project__meta { display: none; } }

/* ---------- 404 ---------- */
.nf { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 1rem; }
.nf h1 { font-family: var(--mono); font-size: 2rem; font-weight: 400; color: var(--ink-3); }

/* ---------- motion ---------- */
.in { opacity: 0; transform: translateY(10px); animation: rise .7s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .in { animation: none; opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .tile, .project, .btn, .item__arrow, .icon-btn { transition: none; }
}
