/* Portfolio template by uniDev.
   Colors live in the two blocks below: change --accent to rebrand the whole page. */
:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
  --pad: clamp(20px, 5vw, 64px);
  --max: 1280px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
[data-theme="light"] {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --ink: #14161b;
  --muted: #5b616d;
  --line: rgba(20, 22, 27, .12);
  --accent: #3b5bfd;
  --on-accent: #ffffff;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d0f13;
  --surface: #161920;
  --ink: #eceef3;
  --muted: #9aa1ae;
  --line: rgba(236, 238, 243, .12);
  --accent: #8297ff;
  --on-accent: #0d0f13;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
  overflow-x: hidden;
}
a { color: inherit; }
img, svg { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -.035em; line-height: 1.05; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }

/* Scroll progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* Header */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--pad); padding-top: max(14px, env(safe-area-inset-top));
  transition: transform .45s var(--ease), background-color .3s, backdrop-filter .3s;
}
.top.scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top.hide { transform: translateY(-100%); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.02em; }
.logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 13px; letter-spacing: 0; }
#nav { display: flex; gap: 6px; }
#nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: 15px; color: var(--muted); transition: color .2s, background-color .2s; }
#nav a:hover { color: var(--ink); background: var(--line); }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
[data-theme="light"] .i-moon, [data-theme="dark"] .i-sun { display: none; }
.menu-btn { display: none; }
.burger { position: relative; width: 18px; height: 10px; }
.burger i { position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: transform .35s var(--ease), top .35s var(--ease); }
.burger i:first-child { top: 0; }
.burger i:last-child { top: 8px; }
.menu-btn[aria-expanded="true"] .burger i:first-child { top: 4px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .burger i:last-child { top: 4px; transform: rotate(-45deg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px;
  padding: 0 26px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg); font: 600 15px var(--font); text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s, color .25s, border-color .25s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); }

/* Hero */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; gap: clamp(28px, 5vh, 56px);
  max-width: var(--max); margin: 0 auto; padding: 120px var(--pad) clamp(40px, 7vh, 72px);
}
.hero-meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.status { display: inline-flex; align-items: center; gap: 10px; }
.dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; }
.dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #22c55e; animation: ping 2s var(--ease) infinite; }
@keyframes ping { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.4); opacity: 0; } }
.clock span { font-variant-numeric: tabular-nums; color: var(--ink); }
.hero-title { font-size: clamp(72px, min(19vw, 25vh), 280px); line-height: .86; letter-spacing: -.065em; font-weight: 600; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .16em; margin-bottom: -.12em; }
.hero-title .indent { padding-left: clamp(0px, 14vw, 220px); }
.hero-title .ch { display: inline-block; }
.js .hero-title .ch { transform: translateY(105%); animation: rise 1s var(--ease) forwards; animation-delay: calc(var(--i) * 45ms + 150ms); }
@keyframes rise { to { transform: none; } }
.hero-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px; }
.lead { max-width: 48ch; font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Ticker */
.ticker { border-block: 1px solid var(--line); overflow: hidden; padding: 22px 0; }
.ticker-track { display: flex; width: max-content; align-items: center; gap: 36px; font-size: clamp(24px, 3.4vw, 44px); font-weight: 500; letter-spacing: -.03em; white-space: nowrap; animation: marquee 32s linear infinite; }
.ticker-track i { font-style: normal; color: var(--accent); font-size: .7em; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sections */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 12vw, 140px) var(--pad); }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(40px, 6vw, 80px); }
.section-head p { color: var(--muted); max-width: 42ch; justify-self: end; }

/* Work index */
.work { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row a {
  position: relative; display: grid; grid-template-columns: 1.4fr 1fr 80px 40px; align-items: center; gap: 20px;
  padding: clamp(22px, 3vw, 34px) 4px; border-bottom: 1px solid var(--line); text-decoration: none;
  transition: padding .4s var(--ease), color .3s;
}
.r-title { font-size: clamp(28px, 4vw, 52px); font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }
.r-kind, .r-year { color: var(--muted); }
.r-year { font-variant-numeric: tabular-nums; }
.r-arrow { justify-self: end; font-size: 22px; transition: transform .35s var(--ease); }
.row a:hover .r-arrow { transform: translate(4px, -4px); color: var(--a); }
.row a:hover { padding-left: 18px; }
.row a:hover .r-title { color: var(--a); }
.thumb { display: none; }

/* Mock website used as project image */
.mock { position: relative; width: 100%; height: 100%; border-radius: 12px; overflow: hidden; background: var(--b); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .35); }
.mock .bar { display: flex; gap: 5px; padding: 9px 11px; background: rgba(255, 255, 255, .55); }
.mock .bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .35; }
.mock .m-nav { position: absolute; left: 8%; right: 8%; top: 17%; height: 5%; border-radius: 4px; background: linear-gradient(90deg, var(--c) 0 18%, transparent 18% 60%, color-mix(in srgb, var(--c) 30%, transparent) 60%); }
.mock .m-h1 { position: absolute; left: 8%; top: 31%; width: 56%; height: 11%; border-radius: 6px; background: var(--c); }
.mock .m-h2 { position: absolute; left: 8%; top: 46%; width: 38%; height: 5%; border-radius: 4px; background: color-mix(in srgb, var(--c) 45%, transparent); }
.mock .m-img { position: absolute; right: 8%; bottom: 0; width: 46%; height: 52%; border-radius: 10px 10px 0 0; background: radial-gradient(circle at 30% 30%, #fff8 0 14%, transparent 15%), linear-gradient(140deg, var(--a), var(--c)); }

/* Floating preview for mouse users */
.preview { position: fixed; left: 0; top: 0; z-index: 40; width: 340px; aspect-ratio: 4 / 3; pointer-events: none; opacity: 0; transform: translate3d(-50%, -50%, 0) scale(.85); transition: opacity .3s var(--ease); }
.preview.on { opacity: 1; }
.preview .thumb { display: block; width: 100%; height: 100%; }
.preview .card-slot { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; }
.preview .card-slot.active { opacity: 1; }

/* Numbers */
.stats { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { border-top: 1px solid var(--ink); padding-top: 20px; display: grid; gap: 8px; }
.stat b { font-size: clamp(56px, 8vw, 112px); line-height: 1; letter-spacing: -.06em; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat > span { color: var(--muted); max-width: 26ch; }

/* About */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.portrait { margin: 0; position: sticky; top: 100px; }
.portrait-art {
  aspect-ratio: 4 / 5; border-radius: var(--radius); display: grid; place-items: end start; padding: 24px; overflow: hidden;
  background: radial-gradient(120% 80% at 80% 10%, color-mix(in srgb, var(--accent) 70%, #fff) 0, transparent 55%), linear-gradient(160deg, var(--accent), #121a4d);
}
.portrait-art span { font-size: clamp(64px, 9vw, 120px); font-weight: 600; letter-spacing: -.06em; color: #fff; line-height: .8; }
.portrait figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.about-copy { display: grid; gap: 22px; }
.about-copy h2 { font-size: clamp(34px, 4.6vw, 60px); }
.about-copy p { font-size: 18px; color: var(--muted); max-width: 56ch; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.timeline span { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline b { font-weight: 500; }

/* Testimonials */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.quote { margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.quote blockquote { margin: 0; font-size: 19px; line-height: 1.5; letter-spacing: -.01em; }
.quote figcaption { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.quote figcaption b { display: block; color: var(--ink); font-weight: 600; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--a); color: #fff; font-weight: 600; font-size: 14px; flex: none; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); }
.contact-head { display: grid; align-content: start; gap: 20px; }
.contact-head h2 { font-size: clamp(40px, 6vw, 84px); }
.mail { font-size: clamp(24px, 3vw, 36px); font-weight: 600; letter-spacing: -.03em; text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size .45s var(--ease); width: fit-content; }
.mail:hover { background-size: 100% 2px; }
.contact-head p { color: var(--muted); }
#form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
#form label { display: grid; gap: 8px; font-size: 14px; font-weight: 500; }
#form .wide { grid-column: 1 / -1; }
input, textarea {
  width: 100%; min-height: 50px; padding: 13px 15px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 16px var(--font); transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { font-size: 14px; font-weight: 500; margin-bottom: 8px; padding: 0; }
.chips label { display: block !important; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.chips span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.chips input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
#form .btn { justify-self: start; }
.form-note { grid-column: 1 / -1; min-height: 1.6em; font-size: 14px; color: var(--muted); }

/* Footer */
.foot { max-width: var(--max); margin: 0 auto; padding: 32px var(--pad) max(32px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.social { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* Scroll reveal */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* Tablet */
@media (max-width: 960px) {
  .quotes { grid-template-columns: 1fr; }
  .about, .contact { grid-template-columns: 1fr; }
  .portrait { position: static; max-width: 420px; }
  .row a { grid-template-columns: 1fr auto 40px; }
  .r-kind { display: none; }
}

/* Phone */
@media (max-width: 720px) {
  .menu-btn { display: grid; }
  #nav {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; gap: 4px;
    padding: 96px var(--pad) 40px; background: var(--bg);
    clip-path: inset(0 0 100% 0); transition: clip-path .6s var(--ease); visibility: hidden;
  }
  #nav.open { clip-path: inset(0 0 0 0); visibility: visible; }
  /* backdrop-filter and transform would trap the fixed menu inside the header */
  .top.menu-open { backdrop-filter: none; -webkit-backdrop-filter: none; transform: none; background: transparent; border-color: transparent; }
  #nav a { font-size: 40px; font-weight: 600; letter-spacing: -.04em; color: var(--ink); padding: 8px 0; border-radius: 0; opacity: 0; transform: translateY(20px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
  #nav a:hover { background: none; }
  #nav.open a { opacity: 1; transform: none; }
  #nav.open a:nth-child(2) { transition-delay: .06s; }
  #nav.open a:nth-child(3) { transition-delay: .12s; }
  #nav.open a:nth-child(4) { transition-delay: .18s; }
  .logo-text { display: none; }
  .hero { padding-top: 100px; }
  .hero-title .indent { padding-left: 0; }
  .hero-foot { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 auto; }
  .section-head { grid-template-columns: 1fr; }
  .section-head p { justify-self: start; }
  .work { border-top: 0; display: grid; gap: 28px; }
  .row a { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 0 0 20px; }
  .row a:hover { padding-left: 0; }
  .thumb { display: block; grid-column: 1 / -1; aspect-ratio: 4 / 3; margin-bottom: 12px; }
  .r-kind { display: block; grid-column: 1; grid-row: 3; font-size: 15px; }
  .r-year { grid-column: 2; grid-row: 2; justify-self: end; }
  .r-arrow { display: none; }
  .stats { grid-template-columns: 1fr; gap: 28px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  #form { grid-template-columns: 1fr; }
  #form .btn { justify-self: stretch; }
  .foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .hero-title .ch { transform: none; }
}
