/* Oscar Peli — portfolio site
   Palette: near-black ground, Kotlin-purple + cyan accents */

/* Inter, self-hosted (variable font, weights 100-900) — no third-party
   font request on page load, so no visitor data is ever sent to Google. */
@font-face{
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face{
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root{
  --bg: #0b0e14;
  --bg-soft: #0e1219;
  --surface: #141925;
  --surface-2: #1a2130;
  --border: #262e40;
  --text: #eef1f8;
  --text-dim: #a4adc2;
  --text-faint: #6b7590;
  --accent: #8a63ff;
  --accent-2: #35d0c9;
  --accent-ios: #4da3ff;
  --accent-android: #6cd67a;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;
  --shadow: 0 20px 50px -25px rgba(0,0,0,.6);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  padding-top: 68px;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(138,99,255,.18), transparent 60%),
    radial-gradient(700px 480px at 100% 0%, rgba(53,208,201,.12), transparent 55%),
    var(--bg);
}

a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }
ul{ margin: 0; padding: 0; }
h1,h2,h3,h4{ line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.02em; }
p{ margin: 0; }

.wrap{ max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- Header ---------- */
.site-header{
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
}
/* position:fixed (not sticky) is deliberate: iOS Safari has a long-standing bug
   where a position:fixed descendant (the mobile nav panel) gets trapped inside
   a position:sticky ancestor and renders relative to it instead of the viewport,
   even with no transform/filter involved. Since the header is the very first
   thing on the page, fixed behaves identically to sticky here but sidesteps the
   bug — body gets padding-top: 68px above to reclaim the flow space fixed removes.
   The blur also lives on a pseudo-element rather than .site-header itself, so the
   header never becomes a containing block for fixed descendants via backdrop-filter
   either (transform/filter/backdrop-filter on an ancestor traps position:fixed
   children inside that ancestor's box instead of the viewport). */
.site-header::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(11,14,20,.75);
  backdrop-filter: blur(14px) saturate(140%);
}
.site-header .wrap{
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand{ display:flex; align-items:center; gap:10px; font-weight: 700; font-size: 1.05rem; }
.brand-mark{
  width: 34px; height: 34px; border-radius: 9px;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0e14; font-weight: 800; font-size: .82rem;
}
nav.main-nav{ display:flex; align-items:center; gap: 6px; }
nav.main-nav a{
  padding: 9px 14px; border-radius: 100px; font-size: .92rem;
  color: var(--text-dim); font-weight: 500;
  transition: color .15s ease, background .15s ease;
}
nav.main-nav a:hover{ color: var(--text); background: var(--surface); }
nav.main-nav a.active{ color: var(--text); background: var(--surface-2); }
.nav-toggle{
  display:none; background:none; border: 1px solid var(--border); color: var(--text);
  width:40px; height:40px; border-radius: 9px; font-size: 1.1rem; cursor:pointer;
}

/* ---------- Language switcher ---------- */
.lang-switch{ display:flex; align-items:center; gap: 4px; margin-left: 6px; flex: none; }
.lang-switch a{
  display:flex; align-items:center; justify-content:center;
  width: 32px; height: 32px; border-radius: 8px; font-size: 1rem; line-height: 1;
  border: 1px solid transparent; opacity: .5; filter: grayscale(60%);
  transition: opacity .15s ease, filter .15s ease, border-color .15s ease, background .15s ease;
}
.lang-switch a:hover{ opacity: .85; filter: grayscale(20%); background: var(--surface); }
.lang-switch a.active{ opacity: 1; filter: none; border-color: var(--border); background: var(--surface); }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex; align-items:center; gap: 8px;
  padding: 11px 20px; border-radius: 100px;
  font-weight: 600; font-size: .92rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{
  background: linear-gradient(135deg, var(--accent), #6d4dff);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(138,99,255,.6);
}
.btn-primary:hover{ filter: brightness(1.08); }
.btn-ghost{
  background: var(--surface); color: var(--text); border-color: var(--border);
}
.btn-ghost:hover{ background: var(--surface-2); }
.btn-sm{ padding: 7px 14px; font-size: .82rem; }
.btn svg{ width: 15px; height: 15px; }

/* ---------- Hero ---------- */
.hero{ padding: 92px 0 64px; }
.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  color: var(--accent-2); font-weight: 600; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .12em;
  margin-bottom: 18px;
}
.eyebrow::before{ content:""; width:7px; height:7px; border-radius:50%; background: var(--accent-2); box-shadow: 0 0 0 4px rgba(53,208,201,.15); }
.hero h1{ font-size: clamp(2.2rem, 5vw, 3.4rem); max-width: 16ch; }
.hero h1 .accent{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead{
  margin-top: 20px; max-width: 62ch; color: var(--text-dim); font-size: 1.08rem;
}
.hero-cta{ display:flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

.stat-row{
  display:grid; grid-template-columns: repeat(4,1fr); gap: 1px;
  margin-top: 64px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius); overflow:hidden;
}
.stat{ background: var(--surface); padding: 22px 20px; }
.stat b{ display:block; font-size: 1.7rem; background: linear-gradient(135deg, var(--text), var(--text-dim)); -webkit-background-clip:text; background-clip:text; }
.stat span{ color: var(--text-faint); font-size: .82rem; }

/* ---------- Section scaffolding ---------- */
section{ padding: 76px 0; border-top: 1px solid var(--border); scroll-margin-top: 68px; }
section.no-border{ border-top: none; }
.section-head{ margin-bottom: 40px; max-width: 68ch; }
.section-head .eyebrow{ margin-bottom: 12px; }
.section-head h2{ font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-head p{ margin-top: 12px; color: var(--text-dim); }
.section-foot{ margin-top: 40px; }

/* ---------- About ---------- */
.about-grid{ display:grid; grid-template-columns: 1.3fr .9fr; gap: 48px; align-items:start; }
.about-grid p + p{ margin-top: 14px; }
.about-grid .lead-text{ color: var(--text-dim); }
.about-grid .lead-text strong{ color: var(--text); }

.badge-cloud{ display:flex; flex-wrap: wrap; gap: 8px; }
.badge{
  padding: 7px 13px; border-radius: 100px; font-size: .82rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
}
.badge.ios{ color: var(--accent-ios); border-color: rgba(77,163,255,.3); }
.badge.android{ color: var(--accent-android); border-color: rgba(108,214,122,.3); }
.badge.kmp{ color: var(--accent); border-color: rgba(138,99,255,.35); }

.role-card{
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 14px;
}
.role-card h4{ font-size: .98rem; }
.role-card .role-meta{ color: var(--accent-2); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; display:block; }
.role-card p{ color: var(--text-dim); font-size: .92rem; margin-top: 10px; }

/* ---------- Cards / grid ---------- */
.card-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.app-card{
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display:flex; flex-direction:column; gap: 14px;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.app-card:hover{ border-color: rgba(138,99,255,.4); transform: translateY(-2px); background: var(--surface-2); }
.app-card-top{ display:flex; align-items:center; gap: 14px; }
.app-icon{
  width: 56px; height: 56px; border-radius: 14px; overflow:hidden; flex: none;
  background: var(--surface-2); border: 1px solid var(--border);
}
.app-icon img{ width:100%; height:100%; object-fit: cover; }
.app-card h3{ font-size: 1.02rem; }
.app-year{ color: var(--text-faint); font-size: .78rem; font-weight: 600; }
.app-card .desc{ color: var(--text-dim); font-size: .89rem; flex: 1; }
.app-client{ font-size: .78rem; color: var(--accent-2); font-weight: 600; }
.tag-row{ display:flex; flex-wrap:wrap; gap: 6px; }
.tag{ font-size: .72rem; padding: 4px 9px; border-radius: 100px; background: var(--surface-2); color: var(--text-faint); border: 1px solid var(--border); font-weight: 600; }
.store-row{ display:flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

/* filter tabs */
.filter-row{ display:flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-btn{
  padding: 9px 16px; border-radius: 100px; font-size: .85rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer;
}
.filter-btn.active{ background: linear-gradient(135deg, var(--accent), #6d4dff); color: #fff; border-color: transparent; }

/* featured project panel */
.feature-panel{
  display:grid; grid-template-columns: .9fr 1.1fr; gap: 36px; align-items:center;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: 20px; padding: 36px; margin-bottom: 44px;
}
.feature-panel .app-icon{ width: 84px; height: 84px; border-radius: 20px; }
.feature-panel h3{ font-size: 1.5rem; margin-top: 14px; }
.feature-panel p{ color: var(--text-dim); margin-top: 12px; }
.feature-panel .store-row{ margin-top: 18px; }

/* library table */
.lib-table{ width:100%; border-collapse: collapse; margin-top: 8px; }
.lib-table th{ text-align:left; color: var(--text-faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.lib-table td{ padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.lib-table td:first-child{ font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.lib-table tr:last-child td{ border-bottom: none; }
.table-wrap{ overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------- Timeline ---------- */
.timeline{ position: relative; padding-left: 28px; border-left: 2px solid var(--border); }
.tl-item{ position: relative; padding-bottom: 34px; }
.tl-item:last-child{ padding-bottom: 0; }
.tl-item::before{
  content:""; position:absolute; left: -33.5px; top: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(138,99,255,.18);
}
.tl-item .tl-date{ color: var(--accent-2); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.tl-item h4{ font-size: 1.02rem; margin-top: 6px; }
.tl-item p{ color: var(--text-dim); font-size: .92rem; margin-top: 8px; }
.tl-item ul{ margin-top: 8px; padding-left: 18px; color: var(--text-dim); font-size: .92rem; }
.tl-item li{ margin-top: 4px; }

/* ---------- Publications ---------- */
.cover-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.cover-card{ border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.cover-card img{ width:100%; aspect-ratio: 3/4; object-fit: cover; }
.cover-card .cc-cap{ padding: 10px 12px; font-size: .78rem; color: var(--text-dim); }
.cover-card .cc-cap b{ display:block; color: var(--text); font-size: .82rem; margin-bottom: 2px; }

.pub-list{ border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.pub-row{ display:flex; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--border); align-items: baseline; }
.pub-row:last-child{ border-bottom: none; }
.pub-date{ color: var(--text-faint); font-size: .8rem; font-weight: 600; flex: none; width: 130px; }
.pub-title{ font-size: .92rem; }
.pub-mag{ color: var(--accent-2); font-size: .78rem; font-weight: 600; margin-left: 8px; }

/* ---------- Contact ---------- */
.contact-panel{
  display:flex; align-items:center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(138,99,255,.14), rgba(53,208,201,.08));
  border: 1px solid var(--border); border-radius: 20px; padding: 40px;
}
.contact-panel h2{ font-size: 1.7rem; max-width: 20ch; }
.contact-panel p{ color: var(--text-dim); margin-top: 10px; max-width: 42ch; }
.contact-links{ display:flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
footer{ border-top: 1px solid var(--border); padding: 36px 0; }
footer .wrap{ display:flex; justify-content: space-between; align-items:center; flex-wrap: wrap; gap: 12px; }
footer p{ color: var(--text-faint); font-size: .82rem; }
footer .foot-links{ display:flex; gap: 18px; }
footer .foot-links a{ color: var(--text-faint); font-size: .82rem; }
footer .foot-links a:hover{ color: var(--text-dim); }

/* legal / privacy page */
.legal{ max-width: 760px; margin: 0 auto; padding: 56px 28px 90px; }
.legal h1{ font-size: 1.8rem; }
.legal .updated{ color: var(--text-faint); font-size: .85rem; margin-top: 8px; }
.legal h2{ font-size: 1.15rem; margin-top: 40px; }
.legal p{ color: var(--text-dim); margin-top: 14px; font-size: .95rem; }
.legal ul{ margin-top: 14px; padding-left: 20px; color: var(--text-dim); font-size: .95rem; }
.legal li{ margin-top: 8px; }
.legal a{ color: var(--accent-2); text-decoration: underline; }
.legal strong{ color: var(--text); }

/* page intro (non-home pages) */
.page-hero{ padding: 64px 0 20px; }
.page-hero .eyebrow{ margin-bottom: 14px; }
.page-hero h1{ font-size: clamp(1.9rem, 4vw, 2.6rem); }
.page-hero p{ margin-top: 16px; color: var(--text-dim); max-width: 64ch; font-size: 1.02rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px){
  .about-grid{ grid-template-columns: 1fr; }
  .feature-panel{ grid-template-columns: 1fr; }
  .stat-row{ grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 720px){
  nav.main-nav{
    position: fixed; top: 68px; left: 0; right: 0; bottom:0;
    background: var(--bg); flex-direction: column; align-items: stretch;
    padding: 18px; gap: 4px; transform: translateX(100%);
    transition: transform .2s ease; overflow-y:auto;
  }
  nav.main-nav.open{ transform: translateX(0); }
  nav.main-nav a{ padding: 14px 16px; font-size: 1rem; }
  .nav-toggle{ display:block; }
  .pub-row{ flex-direction: column; gap: 4px; }
  .pub-date{ width:auto; }
  .contact-panel{ flex-direction: column; align-items: flex-start; }
}
