/* aionale.com stylesheet.
 *
 * Theme: every colour token is declared ONCE as light-dark(<light>, <dark>).
 * Which half wins follows `color-scheme`, so the OS preference needs no media
 * query and works with JS off. The manual toggle only flips `color-scheme` via
 * [data-theme] on <html> (set by theme-init.js / main.js).
 * Brand palette (brand kit README): black #0B0B0D, white #F2F2F2,
 * red #FF2A3D, grey #6A6A70. Font: Chakra Petch SemiBold. */

/* ---------- font ---------- */
/* Self-hosted (no Google CDN: GDPR + one less connection). SIL OFL, from the brand kit.
   Only SemiBold exists in the file, so it's declared as 600 and used for display
   type only; body text uses the system stack. */
@font-face{
  font-family:'Chakra Petch';
  font-style:normal;
  font-weight:600;
  font-display:swap;
  src:url('/assets/fonts/ChakraPetch-SemiBold.woff2') format('woff2');
}

/* ---------- tokens ---------- */
:root{
  color-scheme:light dark;

  --black:#0b0b0d;
  --white:#f2f2f2;
  --red:#ff2a3d;
  --grey:#6a6a70;

  --bg:        light-dark(#f2f2f2, #0b0b0d);
  --surface:   light-dark(#ffffff, #131317);
  --surface-2: light-dark(#e8e8ea, #1a1a1f);
  --text:      light-dark(#1a1a1e, #dcdce0);
  --strong:    light-dark(#0b0b0d, #f2f2f2);
  --muted:     light-dark(#55555b, #9b9ba2);   /* ≥4.5:1 on --bg and --surface */
  --line:      light-dark(#d4d4d8, #26262c);
  --line-2:    light-dark(#b8b8be, #3a3a42);
  --hex-line:  var(--grey);
  --ghost:     light-dark(#dcdce0, #2a2a31);   /* the big background logo */
  /* Red as *text* on the light background needs to be darker to pass AA.
     Red as a fill (buttons, slashes) stays brand red in both modes. */
  --accent:    light-dark(#c8102a, #ff2a3d);
  --on-red:    #0b0b0d;

  --font-display:'Chakra Petch', ui-sans-serif, system-ui, sans-serif;
  --font-body:ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --max:1200px;
  --pad:clamp(20px, 5vw, 40px);
  --cut:14px;   /* the chamfered-corner size used on cards and buttons */
  --measure:780px; /* shared right edge for text blocks: empty state, About, Find me */
}
:root[data-theme="light"]{color-scheme:light}
:root[data-theme="dark"] {color-scheme:dark}

/* Engines without light-dark() (pre ~mid-2024). Modern browsers skip this.
   If you change a colour above, change it here too. */
@supports not (color: light-dark(#fff, #000)){
  :root{
    --bg:#f2f2f2; --surface:#fff; --surface-2:#e8e8ea; --text:#1a1a1e; --strong:#0b0b0d;
    --muted:#55555b; --line:#d4d4d8; --line-2:#b8b8be; --accent:#c8102a; --ghost:#dcdce0;
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --bg:#0b0b0d; --surface:#131317; --surface-2:#1a1a1f; --text:#dcdce0; --strong:#f2f2f2;
      --muted:#9b9ba2; --line:#26262c; --line-2:#3a3a42; --accent:#ff2a3d; --ghost:#2a2a31;
    }
  }
  :root[data-theme="dark"]{
    --bg:#0b0b0d; --surface:#131317; --surface-2:#1a1a1f; --text:#dcdce0; --strong:#f2f2f2;
    --muted:#9b9ba2; --line:#26262c; --line-2:#3a3a42; --accent:#ff2a3d; --ghost:#2a2a31;
  }
}

/* ---------- base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;overflow-x:clip}
@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto}*{transition:none!important}}
body{
  margin:0;overflow-x:clip;
  background:var(--bg);
  color:var(--text);
  font:17px/1.6 var(--font-body);
  -webkit-font-smoothing:antialiased;
}
::selection{background:var(--red);color:var(--on-red)}
a{color:inherit}
:focus-visible{outline:2px solid var(--red);outline-offset:3px}
img{max-width:100%;height:auto;display:block}
h1,h2,h3{font-family:var(--font-display);font-weight:600;color:var(--strong);margin:0;letter-spacing:-.01em}

.shell{width:100%;max-width:var(--max);margin-inline:auto;padding-inline:var(--pad)}
.defs{position:absolute;width:0;height:0;overflow:hidden}
.skip{position:absolute;left:-9999px;top:8px;z-index:10;background:var(--red);color:var(--on-red);padding:8px 14px;font-weight:600}
.skip:focus{left:8px}

/* ---------- header ---------- */
.top{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:16px;padding-block:22px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--strong)}
.brand__icon{width:38px;height:38px;color:var(--strong)}
.brand__name{font-family:var(--font-display);font-weight:600;font-size:22px;letter-spacing:.01em;line-height:1}
.brand__name b{font-weight:600;color:var(--red)}
.top__nav{display:flex;align-items:center;gap:clamp(14px,2.5vw,28px)}
.top__nav a{font:600 16px/1 var(--font-display);text-decoration:none;color:var(--muted)}
.top__nav a:hover{color:var(--strong)}

.theme-btn{
  display:inline-flex;align-items:center;gap:7px;
  font:600 14px/1 var(--font-display);
  color:var(--muted);background:transparent;border:1px solid var(--line-2);
  padding:8px 11px;cursor:pointer;
}
.theme-btn[hidden]{display:none}
.theme-btn:hover{color:var(--strong);border-color:var(--strong)}
.theme-btn svg{width:14px;height:14px}
.theme-btn circle{fill:none;stroke:currentColor;stroke-width:2}
.theme-btn path{fill:currentColor}

/* ---------- hero ---------- */
/* Oversized logo behind the headline, in a pale tone so only the red slash shows.
   Text and mark share one grid cell so they overlap. */
.hero{display:grid;align-items:center;padding-block:clamp(32px,6vw,96px) clamp(48px,7vw,104px)}
.hero > *{grid-area:1/1}
.hero__text{position:relative;z-index:1}
.hero h1{font-size:clamp(56px,10vw,160px);line-height:.9;letter-spacing:-.03em}
.lede{font-size:clamp(18px,1.6vw,22px);color:var(--muted);max-width:30em;margin:28px 0 0}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px;margin:36px 0 0}
/* Hero link to the projects list, shown once there is at least one project. */
.hero__projects{display:none}
body:has(.project) .hero__projects{display:inline}
.hero__mark{
  justify-self:end;width:min(48%,600px);height:auto;
  color:var(--ghost);--hex-line:var(--ghost);
  pointer-events:none;
  /* the hexagon sits ~12% inside its viewBox; shift it so its tip lines up with the content edge */
  transform:translateX(12%);
}

/* ---------- buttons & links ---------- */
.btn{
  display:inline-flex;align-items:center;gap:8px;
  font:600 17px/1 var(--font-display);text-decoration:none;
  padding:15px 24px 15px 22px;background:var(--red);color:var(--on-red);border:0;
  clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,10px 100%,0 calc(100% - 10px));
}
.btn:hover{background:var(--strong);color:var(--bg)}
.link{
  font:600 17px/1 var(--font-display);
  color:var(--strong);text-decoration:none;border-bottom:2px solid var(--red);padding-bottom:3px;
}
.link:hover{color:var(--accent)}

/* ---------- sections ---------- */
.section{padding-block:clamp(40px,5vw,60px)}
.section__title{
  display:flex;align-items:center;gap:14px;
  font-size:clamp(30px,4vw,44px);line-height:1.1;margin-bottom:clamp(22px,3.5vw,36px);
}
.section__title::before{
  /* the red slash from the logo, same 30-degree angle */
  content:"";flex:none;width:.5em;height:.29em;background:var(--red);
  clip-path:polygon(0 64%,100% 0,100% 36%,0 100%);
}

/* ---------- projects ---------- */
.projects{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,360px),1fr));gap:24px}
.projects__empty{grid-column:1/-1;max-width:var(--measure);display:flex;align-items:center;gap:clamp(12px,2vw,20px)}
.projects__empty p{margin:0;color:var(--muted)}
.projects__empty a{color:var(--strong);text-decoration-color:var(--red);text-underline-offset:3px}
.projects:has(.project) .projects__empty{display:none}
.bay{
  /* an empty slot where the first project will go */
  flex:none;width:clamp(84px,12vw,128px);height:auto;
  fill:none;stroke:var(--line-2);stroke-width:10;stroke-dasharray:28 18;
}

/* A clipped border loses its diagonals, so the outline is the card's own background
   showing 1px around a fill layer (::before) cut slightly smaller. 0.6px keeps the
   diagonal line as thick as the straight ones. */
.project{
  --cut-in:calc(var(--cut) - .6px);
  position:relative;isolation:isolate;
  display:flex;flex-direction:column;padding:1px;background:var(--line);
  clip-path:polygon(0 0,calc(100% - var(--cut)) 0,100% var(--cut),100% 100%,var(--cut) 100%,0 calc(100% - var(--cut)));
}
.project::before{
  content:"";position:absolute;inset:1px;z-index:-1;background:var(--surface);
  clip-path:polygon(0 0,calc(100% - var(--cut-in)) 0,100% var(--cut-in),100% 100%,var(--cut-in) 100%,0 calc(100% - var(--cut-in)));
}
.project:hover{background:var(--line-2)}
.project__shot{
  display:block;aspect-ratio:16/9;overflow:hidden;background:var(--surface-2);border-bottom:1px solid var(--line);
  clip-path:polygon(0 0,calc(100% - var(--cut-in)) 0,100% var(--cut-in),100% 100%,0 100%);
}
.project__shot img{width:100%;height:100%;object-fit:cover}
.project__body{padding:22px 24px 24px;display:flex;flex-direction:column;gap:12px;flex:1}
.project__body > p{margin:0}
.project h3{font-size:28px;line-height:1.1}
.project__title{display:flex;align-items:center;gap:12px}
.project__icon{flex:none;width:48px;height:48px;border-radius:11px}
.project__meta{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;
  font:600 14px/1 var(--font-display);color:var(--muted);
}
.project__links{display:flex;flex-wrap:wrap;align-items:center;gap:18px;margin-top:auto!important;padding-top:8px}

.status{display:inline-flex;align-items:center;gap:7px;color:var(--strong)}
.status::before{content:"";width:9px;height:8px;background:currentColor;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%)}
.status--live::before{background:#2fbf71}
.status--dev::before{background:var(--red)}
.status--proto::before{background:#f2b632}
.status--paused::before{background:var(--grey)}

.tags{display:flex;flex-wrap:wrap;gap:6px;list-style:none;margin:0;padding:0}
.tags li{font-size:14px;line-height:1;color:var(--muted);padding:6px 9px;background:var(--surface-2)}

/* ---------- about ---------- */
.about{max-width:var(--measure)}
.about p{margin:0 0 1em;font-size:clamp(19px,1.9vw,22px);line-height:1.55;color:var(--text)}
.about p:last-child{margin-bottom:0}

/* ---------- socials ---------- */
.socials{list-style:none;margin:0;padding:0;border-bottom:1px solid var(--line);max-width:var(--measure)}
.socials a{
  display:grid;grid-template-columns:auto 1fr auto;grid-template-areas:"icon net go" "icon handle go";
  align-items:center;column-gap:clamp(16px,2.5vw,28px);
  padding:clamp(16px,2vw,24px) clamp(4px,1vw,16px);border-top:1px solid var(--line);
  text-decoration:none;color:var(--strong);
}
.socials__icon{
  grid-area:icon;width:clamp(36px,4vw,48px);height:clamp(36px,4vw,48px);padding:clamp(8px,1vw,11px);
  fill:currentColor;background:var(--surface-2);
  clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);
}
.socials__net{grid-area:net;font:600 clamp(24px,2.6vw,32px)/1.1 var(--font-display)}
.socials__handle{grid-area:handle;font-size:15px;color:var(--muted)}
.socials__go{grid-area:go;font:600 16px/1 var(--font-display);color:var(--muted)}
.socials a:hover{background:var(--surface)}
.socials a:hover .socials__icon{background:var(--red);color:var(--on-red)}
.socials a:hover .socials__go{color:var(--accent)}

/* ---------- footer ---------- */
.foot{
  display:flex;flex-wrap:wrap;justify-content:space-between;gap:16px;
  padding-block:32px 48px;margin-top:40px;
  /* top rule spans the content width, not the side padding */
  background:linear-gradient(var(--line),var(--line)) var(--pad) 0/calc(100% - 2 * var(--pad)) 1px no-repeat;
  font-size:15px;color:var(--muted);
}
.foot a{text-decoration:none}
.foot a:hover{color:var(--strong)}

/* ---------- 404 ---------- */
.notfound{padding-block:clamp(64px,12vw,160px)}
.notfound > *{max-width:40rem}
.notfound h1{font-size:clamp(44px,8vw,96px);line-height:.95;letter-spacing:-.03em}

/* ---------- responsive ----------
   Phone < 640px, tablet 640-1023px desktop 1024px+, wide 1440px+ */
@media (min-width: 1024px){
  body{font-size:18px}
  /* Side headings: the title gets its own column, content uses the rest. */
  .section{
    display:grid;grid-template-columns:minmax(200px,1fr) 3fr;column-gap:clamp(32px,4vw,64px);
    align-items:start;
  }
  .section > *{grid-column:2;grid-row:1}
  .section > .section__title{grid-column:1;margin-bottom:0;padding-top:.15em}
  .socials a{padding-inline:16px}
}
@media (min-width: 1440px){
  :root{--max:1320px}
}
@media (max-width: 1023px){
  .hero__mark{width:min(52%,440px);opacity:.8}
}
@media (max-width: 639px){
  .top__nav a{display:none}
  /* phones: the mark gets its own row above the headline instead of sitting behind the text */
  .hero > *{grid-area:auto}
  .hero__mark{order:-1;width:44%;margin-bottom:-10%;opacity:1;transform:none}
  .projects__empty{flex-direction:column;align-items:flex-start}
  .socials__go{display:none}
}
